home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-02-23 | 45.0 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Wed Feb 23 03:36:22 1994, modified Wed Feb 23 03:36:22 1994, creator Think C, type ASCII, 44080 bytes "TransEdit.c" , at 0xacb0 1712 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 54 72 61 6e 73 45 | 64 69 74 2e 63 00 00 00 |..TransE|dit.c...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 ac 30 00 | 00 06 b0 a9 90 c6 06 a9 |......0.|........|
|00000060| 90 c6 06 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 70 e6 00 00 |........|....p...|
|00000080| 2f 2a 0d 20 2a 20 2d 20 | 43 68 65 63 6b 20 74 68 |/*. * - |Check th|
|00000090| 61 74 20 53 61 76 65 46 | 69 6c 65 20 70 75 74 73 |at SaveF|ile puts|
|000000a0| 20 63 6f 72 72 65 63 74 | 20 69 6e 69 74 69 61 6c | correct| initial|
|000000b0| 20 6e 61 6d 65 20 69 6e | 2e 0d 20 2a 20 2d 20 4d | name in|.. * - M|
|000000c0| 61 6b 65 20 73 75 72 65 | 20 74 68 61 74 20 66 69 |ake sure| that fi|
|000000d0| 6c 65 6e 61 6d 65 20 67 | 65 74 73 20 69 6e 69 74 |lename g|ets init|
|000000e0| 69 61 6c 69 7a 65 64 20 | 70 72 6f 70 65 72 6c 79 |ialized |properly|
|000000f0| 20 69 6e 20 61 6c 6c 20 | 63 61 73 65 73 2e 0d 20 | in all |cases.. |
|00000100| 2a 2f 0d 0d 2f 2a 0d 20 | 2a 20 54 72 61 6e 73 45 |*/../*. |* TransE|
|00000110| 64 69 74 2e 63 20 76 65 | 72 73 69 6f 6e 20 33 2e |dit.c ve|rsion 3.|
|00000120| 30 35 20 2d 20 54 72 61 | 6e 73 53 6b 65 6c 20 70 |05 - Tra|nsSkel p|
|00000130| 6c 75 67 2d 69 6e 20 6d | 6f 64 75 6c 65 20 73 75 |lug-in m|odule su|
|00000140| 70 70 6f 72 74 69 6e 67 | 20 61 6e 0d 20 2a 20 61 |pporting| an. * a|
|00000150| 72 62 69 74 72 61 72 79 | 20 6e 75 6d 62 65 72 20 |rbitrary| number |
|00000160| 6f 66 20 67 65 6e 65 72 | 69 63 20 65 64 69 74 20 |of gener|ic edit |
|00000170| 77 69 6e 64 6f 77 73 2e | 20 20 45 61 63 68 20 77 |windows.| Each w|
|00000180| 69 6e 64 6f 77 20 6d 61 | 79 20 62 65 0d 20 2a 20 |indow ma|y be. * |
|00000190| 62 6f 75 6e 64 20 74 6f | 20 61 20 66 69 6c 65 2e |bound to| a file.|
|000001a0| 0d 20 2a 20 0d 20 2a 20 | 2a 2a 2a 20 52 65 71 75 |. * . * |*** Requ|
|000001b0| 69 72 65 73 20 46 61 6b | 65 41 6c 65 72 74 2e 63 |ires Fak|eAlert.c|
|000001c0| 20 66 6f 72 20 70 72 6f | 70 65 72 20 6c 69 6e 6b | for pro|per link|
|000001d0| 69 6e 67 21 20 2a 2a 2a | 0d 20 2a 0d 20 2a 20 54 |ing! ***|. *. * T|
|000001e0| 72 61 6e 73 53 6b 65 6c | 20 61 6e 64 20 54 72 61 |ransSkel| and Tra|
|000001f0| 6e 73 45 64 69 74 20 61 | 72 65 20 70 75 62 6c 69 |nsEdit a|re publi|
|00000200| 63 20 64 6f 6d 61 69 6e | 2e 20 20 46 6f 72 20 6d |c domain|. For m|
|00000210| 6f 72 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 2c |ore info|rmation,|
|00000220| 0d 20 2a 20 63 6f 6e 74 | 61 63 74 3a 0d 20 2a 0d |. * cont|act:. *.|
|00000230| 20 2a 20 09 09 09 50 61 | 75 6c 20 44 75 42 6f 69 | * ...Pa|ul DuBoi|
|00000240| 73 0d 20 2a 20 09 09 09 | 57 69 73 63 6f 6e 73 69 |s. * ...|Wisconsi|
|00000250| 6e 20 52 65 67 69 6f 6e | 61 6c 20 50 72 69 6d 61 |n Region|al Prima|
|00000260| 74 65 20 52 65 73 65 61 | 72 63 68 20 43 65 6e 74 |te Resea|rch Cent|
|00000270| 65 72 0d 20 2a 20 09 09 | 09 31 32 32 30 20 43 61 |er. * ..|.1220 Ca|
|00000280| 70 69 74 6f 6c 20 43 6f | 75 72 74 0d 20 2a 20 09 |pitol Co|urt. * .|
|00000290| 09 09 4d 61 64 69 73 6f | 6e 2c 20 57 49 20 20 35 |..Madiso|n, WI 5|
|000002a0| 33 37 31 35 2d 31 32 39 | 39 20 20 55 53 41 0d 20 |3715-129|9 USA. |
|000002b0| 2a 0d 20 2a 20 49 6e 74 | 65 72 6e 65 74 3a 09 64 |*. * Int|ernet:.d|
|000002c0| 75 62 6f 69 73 40 70 72 | 69 6d 61 74 65 2e 77 69 |ubois@pr|imate.wi|
|000002d0| 73 63 2e 65 64 75 0d 20 | 2a 09 09 0d 20 2a 0d 20 |sc.edu. |*... *. |
|000002e0| 2a 20 54 68 69 73 20 76 | 65 72 73 69 6f 6e 20 6f |* This v|ersion o|
|000002f0| 66 20 54 72 61 6e 73 45 | 64 69 74 20 69 73 20 77 |f TransE|dit is w|
|00000300| 72 69 74 74 65 6e 20 66 | 6f 72 20 54 48 49 4e 4b |ritten f|or THINK|
|00000310| 20 43 20 36 2e 30 2e 0d | 20 2a 20 54 48 49 4e 4b | C 6.0..| * THINK|
|00000320| 20 43 20 69 73 20 61 20 | 74 72 61 64 65 6d 61 72 | C is a |trademar|
|00000330| 6b 20 6f 66 3a 0d 20 2a | 0d 20 2a 20 09 09 09 53 |k of:. *|. * ...S|
|00000340| 79 6d 61 6e 74 65 63 20 | 43 6f 72 70 6f 72 61 74 |ymantec |Corporat|
|00000350| 69 6f 6e 0d 20 2a 20 09 | 09 09 31 30 32 30 31 20 |ion. * .|..10201 |
|00000360| 54 6f 72 72 65 20 41 76 | 65 6e 75 65 0d 20 2a 20 |Torre Av|enue. * |
|00000370| 09 09 09 43 75 70 65 72 | 74 69 6e 6f 2c 20 43 41 |...Cuper|tino, CA|
|00000380| 20 39 35 30 31 34 20 20 | 55 53 41 0d 20 2a 0d 20 | 95014 |USA. *. |
|00000390| 2a 20 48 69 73 74 6f 72 | 79 0d 20 2a 20 30 38 2f |* Histor|y. * 08/|
|000003a0| 32 35 2f 38 36 09 47 65 | 6e 65 73 69 73 2e 20 20 |25/86.Ge|nesis. |
|000003b0| 42 65 74 61 20 76 65 72 | 73 69 6f 6e 2e 0d 20 2a |Beta ver|sion.. *|
|000003c0| 20 30 39 2f 31 35 2f 38 | 36 0d 20 2a 20 2d 20 43 | 09/15/8|6. * - C|
|000003d0| 68 61 6e 67 65 64 20 74 | 6f 20 61 6c 6c 6f 77 20 |hanged t|o allow |
|000003e0| 61 72 62 69 74 72 61 72 | 79 20 6e 75 6d 62 65 72 |arbitrar|y number|
|000003f0| 20 6f 66 20 77 69 6e 64 | 6f 77 73 2e 0d 20 2a 0d | of wind|ows.. *.|
|00000400| 20 2a 20 31 31 2f 30 34 | 2f 38 36 20 52 65 6c 65 | * 11/04|/86 Rele|
|00000410| 61 73 65 20 31 2e 30 0d | 20 2a 20 2d 20 41 64 64 |ase 1.0.| * - Add|
|00000420| 65 64 20 63 6f 6e 64 69 | 74 69 6f 6e 61 6c 20 73 |ed condi|tional s|
|00000430| 74 75 66 66 20 74 6f 20 | 61 6c 6c 6f 77 20 63 6f |tuff to |allow co|
|00000440| 6d 70 69 6c 61 74 69 6f | 6e 20 69 6e 20 73 69 6e |mpilatio|n in sin|
|00000450| 67 6c 65 2d 20 6f 72 0d | 20 2a 20 6d 75 6c 74 69 |gle- or.| * multi|
|00000460| 70 6c 65 2d 77 69 6e 64 | 6f 77 20 6d 6f 64 65 2e |ple-wind|ow mode.|
|00000470| 0d 20 2a 0d 20 2a 20 30 | 31 2f 31 37 2f 38 37 20 |. *. * 0|1/17/87 |
|00000480| 52 65 6c 65 61 73 65 20 | 31 2e 30 31 0d 20 2a 20 |Release |1.01. * |
|00000490| 2d 20 54 68 65 20 77 69 | 6e 64 6f 77 20 74 79 70 |- The wi|ndow typ|
|000004a0| 65 20 77 68 65 6e 20 61 | 20 6e 65 77 20 77 69 6e |e when a| new win|
|000004b0| 64 6f 77 20 69 73 20 63 | 72 65 61 74 65 64 20 69 |dow is c|reated i|
|000004c0| 73 20 64 6f 63 75 6d 65 | 6e 74 50 72 6f 63 2b 38 |s docume|ntProc+8|
|000004d0| 0d 20 2a 20 6e 6f 77 2c | 20 73 6f 20 74 68 61 74 |. * now,| so that|
|000004e0| 20 74 68 65 20 77 69 6e | 64 6f 77 20 77 69 6c 6c | the win|dow will|
|000004f0| 20 68 61 76 65 20 61 20 | 7a 6f 6f 6d 20 62 6f 78 | have a |zoom box|
|00000500| 20 6f 6e 20 61 20 6d 61 | 63 68 69 6e 65 20 77 69 | on a ma|chine wi|
|00000510| 74 68 0d 20 2a 20 31 32 | 38 4b 20 52 4f 4d 53 2e |th. * 12|8K ROMS.|
|00000520| 20 20 44 65 66 61 75 6c | 74 20 66 69 6c 65 20 6e | Defaul|t file n|
|00000530| 61 6d 65 20 69 6e 20 53 | 61 76 65 46 69 6c 65 28 |ame in S|aveFile(|
|00000540| 29 20 69 73 20 69 6e 69 | 74 69 61 6c 69 7a 65 64 |) is ini|tialized|
|00000550| 20 61 66 74 65 72 0d 20 | 2a 20 53 79 6e 63 41 6c | after. |* SyncAl|
|00000560| 6c 47 6c 6f 62 61 6c 73 | 28 29 20 2d 20 66 69 78 |lGlobals|() - fix|
|00000570| 69 6e 67 20 62 75 67 20 | 66 6f 75 6e 64 20 62 79 |ing bug |found by|
|00000580| 20 4f 77 65 6e 20 48 61 | 72 74 6e 65 74 74 2e 0d | Owen Ha|rtnett..|
|00000590| 20 2a 0d 20 2a 20 30 31 | 2f 32 39 2f 38 39 20 52 | *. * 01|/29/89 R|
|000005a0| 65 6c 65 61 73 65 20 32 | 2e 30 0d 20 2a 20 2d 20 |elease 2|.0. * - |
|000005b0| 43 6f 6e 76 65 72 74 65 | 64 20 74 6f 20 77 6f 72 |Converte|d to wor|
|000005c0| 6b 20 77 69 74 68 20 54 | 72 61 6e 73 53 6b 65 6c |k with T|ransSkel|
|000005d0| 20 32 2e 30 2e 20 20 32 | 2d 62 79 74 65 20 61 6e | 2.0. 2|-byte an|
|000005e0| 64 0d 20 2a 20 34 2d 62 | 79 74 65 20 69 6e 74 65 |d. * 4-b|yte inte|
|000005f0| 67 65 72 20 74 79 70 65 | 73 20 61 72 65 20 74 79 |ger type|s are ty|
|00000600| 70 65 64 65 66 27 65 64 | 20 74 6f 20 49 6e 74 65 |pedef'ed| to Inte|
|00000610| 67 65 72 20 61 6e 64 20 | 4c 6f 6e 67 49 6e 74 20 |ger and |LongInt |
|00000620| 74 6f 0d 20 2a 20 65 61 | 73 65 20 70 6f 72 74 69 |to. * ea|se porti|
|00000630| 6e 67 2e 20 20 41 64 64 | 65 64 20 53 79 73 74 65 |ng. Add|ed Syste|
|00000640| 6d 45 64 69 74 28 29 20 | 63 68 65 63 6b 20 74 6f |mEdit() |check to|
|00000650| 20 45 64 69 74 20 6d 65 | 6e 75 20 68 61 6e 64 6c | Edit me|nu handl|
|00000660| 65 72 2e 0d 20 2a 0d 20 | 2a 20 31 36 20 4a 75 6e |er.. *. |* 16 Jun|
|00000670| 20 39 32 20 52 65 6c 65 | 61 73 65 20 33 2e 30 31 | 92 Rele|ase 3.01|
|00000680| 0d 20 2a 20 2d 20 50 6f | 72 74 65 64 20 66 6f 72 |. * - Po|rted for|
|00000690| 20 54 72 61 6e 73 53 6b | 65 6c 20 33 2e 30 30 2e | TransSk|el 3.00.|
|000006a0| 20 42 61 73 69 63 61 6c | 6c 79 20 74 68 69 73 20 | Basical|ly this |
|000006b0| 61 6d 6f 75 6e 74 65 64 | 20 74 6f 20 61 64 64 69 |amounted| to addi|
|000006c0| 6e 67 0d 20 2a 20 66 75 | 6e 63 74 69 6f 6e 20 70 |ng. * fu|nction p|
|000006d0| 72 6f 74 6f 74 79 70 65 | 73 2e 0d 20 2a 20 2d 20 |rototype|s.. * - |
|000006e0| 55 73 65 20 72 65 61 6c | 20 63 75 72 6c 79 20 71 |Use real| curly q|
|000006f0| 75 6f 74 65 73 20 69 6e | 20 46 61 6b 65 41 6c 65 |uotes in| FakeAle|
|00000700| 72 74 28 29 20 6d 65 73 | 73 61 67 65 73 2e 0d 20 |rt() mes|sages.. |
|00000710| 2a 0d 20 2a 20 30 35 20 | 4a 75 6e 20 39 33 20 52 |*. * 05 |Jun 93 R|
|00000720| 65 6c 65 61 73 65 20 33 | 2e 30 32 0d 20 2a 20 2d |elease 3|.02. * -|
|00000730| 20 43 6f 6e 76 65 72 73 | 69 6f 6e 20 66 6f 72 20 | Convers|ion for |
|00000740| 54 48 49 4e 4b 20 43 20 | 36 2e 30 2e 0d 20 2a 0d |THINK C |6.0.. *.|
|00000750| 20 2a 20 30 38 20 4a 75 | 6e 20 39 33 20 52 65 6c | * 08 Ju|n 93 Rel|
|00000760| 65 61 73 65 20 33 2e 30 | 33 0d 20 2a 20 2d 20 54 |ease 3.0|3. * - T|
|00000770| 6f 6f 6b 20 6f 75 74 20 | 61 6c 6c 20 74 68 65 20 |ook out |all the |
|00000780| 73 74 75 66 66 20 74 6f | 20 61 6c 6c 6f 77 20 63 |stuff to| allow c|
|00000790| 6f 6d 70 69 6c 69 6e 67 | 20 74 6f 20 68 61 6e 64 |ompiling| to hand|
|000007a0| 6c 65 20 6f 6e 6c 79 20 | 61 20 73 69 6e 67 6c 65 |le only |a single|
|000007b0| 0d 20 2a 20 65 64 69 74 | 20 77 69 6e 64 6f 77 2e |. * edit| window.|
|000007c0| 20 20 54 68 65 20 73 61 | 76 69 6e 67 73 20 69 6e | The sa|vings in|
|000007d0| 20 62 79 74 65 73 20 6f | 66 20 6f 62 6a 65 63 74 | bytes o|f object|
|000007e0| 20 63 6f 64 65 20 69 73 | 20 6e 6f 20 6c 6f 6e 67 | code is| no long|
|000007f0| 65 72 20 77 6f 72 74 68 | 0d 20 2a 20 74 68 65 20 |er worth|. * the |
|00000800| 65 78 74 72 61 20 73 6f | 75 72 63 65 20 63 6f 64 |extra so|urce cod|
|00000810| 65 20 63 6f 6d 70 6c 65 | 78 69 74 79 2e 20 20 49 |e comple|xity. I|
|00000820| 74 27 73 20 61 6c 73 6f | 20 75 6e 6e 65 63 65 73 |t's also| unneces|
|00000830| 73 61 72 79 20 62 65 63 | 61 75 73 65 20 49 20 6e |sary bec|ause I n|
|00000840| 6f 20 6c 6f 6e 67 65 72 | 0d 20 2a 20 6d 61 69 6e |o longer|. * main|
|00000850| 74 61 69 6e 20 61 20 77 | 69 6e 64 6f 77 20 6c 69 |tain a w|indow li|
|00000860| 73 74 2c 20 73 69 6e 63 | 65 20 49 20 2e 2e 2e 0d |st, sinc|e I ....|
|00000870| 20 2a 20 2d 20 52 65 69 | 6d 70 6c 65 6d 65 6e 74 | * - Rei|mplement|
|00000880| 65 64 20 6c 69 6e 6b 65 | 64 20 6c 69 73 74 20 68 |ed linke|d list h|
|00000890| 6f 6c 64 69 6e 67 20 65 | 64 69 74 20 77 69 6e 64 |olding e|dit wind|
|000008a0| 6f 77 20 64 61 74 61 20 | 75 73 69 6e 67 20 54 72 |ow data |using Tr|
|000008b0| 61 6e 73 53 6b 65 6c 27 | 73 0d 20 2a 20 77 69 6e |ansSkel'|s. * win|
|000008c0| 64 6f 77 20 70 72 6f 70 | 65 72 74 79 20 66 75 6e |dow prop|erty fun|
|000008d0| 63 74 69 6f 6e 73 20 28 | 6e 65 77 20 69 6e 20 54 |ctions (|new in T|
|000008e0| 53 20 33 2e 30 30 29 2e | 20 20 54 68 65 20 70 72 |S 3.00).| The pr|
|000008f0| 6f 70 65 72 74 79 20 74 | 79 70 65 20 69 73 0d 20 |operty t|ype is. |
|00000900| 2a 20 73 6b 65 6c 57 50 | 72 6f 70 45 64 69 74 57 |* skelWP|ropEditW|
|00000910| 69 6e 64 2c 20 61 6e 64 | 20 74 68 65 20 64 61 74 |ind, and| the dat|
|00000920| 61 20 76 61 6c 75 65 20 | 69 73 20 61 20 68 61 6e |a value |is a han|
|00000930| 64 6c 65 20 74 6f 20 74 | 68 65 20 77 69 6e 64 6f |dle to t|he windo|
|00000940| 77 20 64 61 74 61 0d 20 | 2a 20 73 74 72 75 63 74 |w data. |* struct|
|00000950| 75 72 65 2e 0d 20 2a 20 | 2d 20 54 6f 6f 6b 20 6f |ure.. * |- Took o|
|00000960| 75 74 20 61 6c 6c 20 74 | 68 65 20 22 72 65 67 69 |ut all t|he "regi|
|00000970| 73 74 65 72 22 20 64 65 | 63 6c 61 72 61 74 69 6f |ster" de|claratio|
|00000980| 6e 73 2e 20 20 54 68 65 | 20 63 6f 6d 70 69 6c 65 |ns. The| compile|
|00000990| 72 27 73 20 73 6d 61 72 | 74 20 65 6e 6f 75 67 68 |r's smar|t enough|
|000009a0| 0d 20 2a 20 6e 6f 77 20 | 74 68 61 74 20 74 68 65 |. * now |that the|
|000009b0| 79 20 64 6f 6e 27 74 20 | 6d 61 6b 65 20 61 6e 79 |y don't |make any|
|000009c0| 20 64 69 66 66 65 72 65 | 6e 63 65 2c 20 73 6f 20 | differe|nce, so |
|000009d0| 74 68 65 79 27 72 65 20 | 6a 75 73 74 20 63 6c 75 |they're |just clu|
|000009e0| 74 74 65 72 2e 0d 20 2a | 20 30 35 20 4a 75 6c 20 |tter.. *| 05 Jul |
|000009f0| 39 33 0d 20 2a 20 2d 20 | 52 65 64 69 64 20 46 61 |93. * - |Redid Fa|
|00000a00| 6b 65 41 6c 65 72 74 28 | 29 20 63 61 6c 6c 73 20 |keAlert(|) calls |
|00000a10| 74 6f 20 63 6f 72 72 65 | 73 70 6f 6e 64 20 62 65 |to corre|spond be|
|00000a20| 74 74 65 72 20 74 6f 20 | 6e 65 77 20 62 75 74 74 |tter to |new butt|
|00000a30| 6f 6e 20 70 6f 73 69 74 | 69 6f 6e 69 6e 67 2e 0d |on posit|ioning..|
|00000a40| 20 2a 20 28 53 65 65 20 | 46 61 6b 65 41 6c 65 72 | * (See |FakeAler|
|00000a50| 74 2e 63 20 72 65 6d 61 | 72 6b 73 2e 29 0d 20 2a |t.c rema|rks.). *|
|00000a60| 20 2d 20 46 69 78 65 64 | 20 41 63 74 69 76 61 74 | - Fixed| Activat|
|00000a70| 65 28 29 20 61 6e 64 20 | 55 70 64 61 74 65 28 29 |e() and |Update()|
|00000a80| 20 73 6f 20 74 68 61 74 | 20 77 68 65 6e 20 61 20 | so that| when a |
|00000a90| 77 69 6e 64 6f 77 20 67 | 6f 65 73 20 69 6e 61 63 |window g|oes inac|
|00000aa0| 74 69 76 65 2c 0d 20 2a | 20 74 68 65 20 73 63 72 |tive,. *| the scr|
|00000ab0| 6f 6c 6c 20 62 61 72 20 | 69 73 20 68 69 64 64 65 |oll bar |is hidde|
|00000ac0| 6e 20 28 61 6e 64 20 6f | 6e 6c 79 20 74 68 65 20 |n (and o|nly the |
|00000ad0| 66 72 61 6d 65 20 64 72 | 61 77 6e 29 2e 20 20 50 |frame dr|awn). P|
|00000ae0| 72 65 76 69 6f 75 73 6c | 79 2c 20 74 68 65 0d 20 |reviousl|y, the. |
|00000af0| 2a 20 73 63 72 6f 6c 6c | 20 62 61 72 20 77 61 73 |* scroll| bar was|
|00000b00| 20 6a 75 73 74 20 6d 61 | 64 65 20 69 6e 61 63 74 | just ma|de inact|
|00000b10| 69 76 65 2c 20 77 68 69 | 63 68 20 64 6f 65 73 6e |ive, whi|ch doesn|
|00000b20| 27 74 20 71 75 69 74 65 | 20 63 6f 6e 66 6f 72 6d |'t quite| conform|
|00000b30| 20 74 6f 20 74 68 65 20 | 75 73 65 72 0d 20 2a 20 | to the |user. * |
|00000b40| 69 6e 74 65 72 66 61 63 | 65 20 67 75 69 64 65 6c |interfac|e guidel|
|00000b50| 69 6e 65 73 2e 0d 20 2a | 20 31 38 20 44 65 63 20 |ines.. *| 18 Dec |
|00000b60| 39 33 0d 20 2a 20 2d 20 | 55 6e 74 69 74 6c 65 64 |93. * - |Untitled|
|00000b70| 20 77 69 6e 64 6f 77 73 | 20 68 61 76 65 20 22 75 | windows| have "u|
|00000b80| 6e 74 69 74 6c 65 64 22 | 20 72 61 74 68 65 72 20 |ntitled"| rather |
|00000b90| 74 68 61 6e 20 22 55 6e | 74 69 74 6c 65 64 22 20 |than "Un|titled" |
|00000ba0| 69 6e 20 74 69 74 6c 65 | 20 62 61 72 2c 0d 20 2a |in title| bar,. *|
|00000bb0| 20 61 6e 64 20 66 69 72 | 73 74 20 75 6e 74 69 74 | and fir|st untit|
|00000bc0| 6c 65 64 20 77 69 6e 64 | 6f 77 20 69 73 6e 27 74 |led wind|ow isn't|
|00000bd0| 20 67 69 76 65 6e 20 61 | 20 6e 75 6d 62 65 72 2c | given a| number,|
|00000be0| 20 69 6e 20 61 63 63 6f | 72 64 61 6e 63 65 20 77 | in acco|rdance w|
|00000bf0| 69 74 68 20 41 70 70 6c | 65 0d 20 2a 20 67 75 69 |ith Appl|e. * gui|
|00000c00| 64 65 6c 69 6e 65 73 2e | 0d 20 2a 20 2d 20 52 65 |delines.|. * - Re|
|00000c10| 70 6c 61 63 65 64 20 53 | 46 47 65 74 46 69 6c 65 |placed S|FGetFile|
|00000c20| 28 29 2f 53 46 50 75 74 | 46 69 6c 65 28 29 20 77 |()/SFPut|File() w|
|00000c30| 69 74 68 20 53 46 50 47 | 65 74 46 69 6c 28 29 2f |ith SFPG|etFil()/|
|00000c40| 53 46 50 50 75 74 46 69 | 6c 65 28 29 20 73 6f 20 |SFPPutFi|le() so |
|00000c50| 63 61 6e 0d 20 2a 20 75 | 73 65 20 53 6b 65 6c 44 |can. * u|se SkelD|
|00000c60| 6c 6f 67 46 69 6c 74 65 | 72 28 29 2e 0d 20 2a 20 |logFilte|r().. * |
|00000c70| 32 31 20 44 65 63 20 39 | 33 0d 20 2a 20 2d 20 55 |21 Dec 9|3. * - U|
|00000c80| 73 65 20 63 6f 6c 6f 72 | 20 67 72 61 66 70 6f 72 |se color| grafpor|
|00000c90| 74 73 20 77 68 65 6e 20 | 61 76 61 69 6c 61 62 6c |ts when |availabl|
|00000ca0| 65 2e 0d 20 2a 20 30 34 | 20 4a 61 6e 20 39 34 0d |e.. * 04| Jan 94.|
|00000cb0| 20 2a 20 2d 20 55 6e 64 | 69 64 20 49 6e 74 65 67 | * - Und|id Integ|
|00000cc0| 65 72 2f 4c 6f 6e 67 49 | 6e 74 20 74 79 70 65 20 |er/LongI|nt type |
|00000cd0| 73 74 75 66 66 20 62 61 | 63 6b 20 74 6f 20 73 68 |stuff ba|ck to sh|
|00000ce0| 6f 72 74 2f 6c 6f 6e 67 | 2e 0d 20 2a 0d 20 2a 20 |ort/long|.. *. * |
|00000cf0| 31 38 20 4a 61 6e 20 39 | 34 20 52 65 6c 65 61 73 |18 Jan 9|4 Releas|
|00000d00| 65 20 33 2e 30 34 0d 20 | 2a 20 2d 20 46 61 6b 65 |e 3.04. |* - Fake|
|00000d10| 41 6c 65 72 74 28 29 20 | 63 6f 64 65 20 72 65 76 |Alert() |code rev|
|00000d20| 61 6d 70 65 64 2e 20 20 | 53 65 65 20 46 61 6b 65 |amped. |See Fake|
|00000d30| 41 6c 65 72 74 2e 63 2e | 0d 20 2a 20 31 39 20 4a |Alert.c.|. * 19 J|
|00000d40| 61 6e 20 39 34 0d 20 2a | 20 2d 20 57 69 6e 64 6f |an 94. *| - Windo|
|00000d50| 77 20 63 72 65 61 74 69 | 6f 6e 20 72 6f 75 74 69 |w creati|on routi|
|00000d60| 6e 65 73 20 64 6f 20 62 | 65 74 74 65 72 20 63 68 |nes do b|etter ch|
|00000d70| 65 63 6b 73 20 66 6f 72 | 20 61 6c 6c 6f 63 61 74 |ecks for| allocat|
|00000d80| 69 6f 6e 20 66 61 69 6c | 75 72 65 73 2e 0d 20 2a |ion fail|ures.. *|
|00000d90| 20 2d 20 4d 75 63 68 20 | 72 65 77 72 69 74 69 6e | - Much |rewritin|
|00000da0| 67 20 74 6f 20 65 6c 69 | 6d 69 6e 61 74 65 20 6d |g to eli|minate m|
|00000db0| 61 6e 79 20 67 6c 6f 62 | 61 6c 20 76 61 72 69 61 |any glob|al varia|
|00000dc0| 62 6c 65 73 2e 20 20 4e | 6f 20 6d 6f 72 65 20 53 |bles. N|o more S|
|00000dd0| 79 6e 63 47 6c 6f 62 61 | 6c 73 28 29 2e 0d 20 2a |yncGloba|ls().. *|
|00000de0| 20 32 30 20 4a 61 6e 20 | 39 34 0d 20 2a 20 2d 20 | 20 Jan |94. * - |
|00000df0| 46 69 78 65 64 20 62 75 | 67 20 77 69 74 68 20 6d |Fixed bu|g with m|
|00000e00| 69 73 73 69 6e 67 20 53 | 6b 65 6c 52 6d 76 65 44 |issing S|kelRmveD|
|00000e10| 6c 6f 67 46 69 6c 74 65 | 72 28 29 20 61 66 74 65 |logFilte|r() afte|
|00000e20| 72 20 53 46 50 47 65 74 | 46 69 6c 65 28 29 20 63 |r SFPGet|File() c|
|00000e30| 61 6c 6c 2e 0d 20 2a 20 | 32 33 20 4a 61 6e 20 39 |all.. * |23 Jan 9|
|00000e40| 34 0d 20 2a 20 2d 20 46 | 69 78 65 64 20 62 75 67 |4. * - F|ixed bug|
|00000e50| 20 69 6e 20 45 57 69 6e | 64 6f 77 45 64 69 74 4f | in EWin|dowEditO|
|00000e60| 70 28 29 3b 20 65 64 69 | 74 20 77 69 6e 64 6f 77 |p(); edi|t window|
|00000e70| 20 64 6f 65 73 6e 27 74 | 20 6e 65 65 64 20 74 6f | doesn't| need to|
|00000e80| 20 62 65 20 6d 61 72 6b | 65 64 20 64 69 72 74 79 | be mark|ed dirty|
|00000e90| 0d 20 2a 20 66 6f 72 20 | 43 6f 70 79 20 6f 70 65 |. * for |Copy ope|
|00000ea0| 72 61 74 69 6f 6e 2e 0d | 20 2a 0d 20 2a 20 32 31 |ration..| *. * 21|
|00000eb0| 20 46 65 62 20 39 34 20 | 52 65 6c 65 61 73 65 20 | Feb 94 |Release |
|00000ec0| 33 2e 30 35 0d 20 2a 20 | 2d 20 55 70 64 61 74 65 |3.05. * |- Update|
|00000ed0| 64 20 66 6f 72 20 54 72 | 61 6e 73 53 6b 65 6c 20 |d for Tr|ansSkel |
|00000ee0| 33 2e 31 31 2e 0d 20 2a | 20 2d 20 43 6f 6e 76 65 |3.11.. *| - Conve|
|00000ef0| 72 74 65 64 20 69 6e 74 | 65 72 66 61 63 65 20 74 |rted int|erface t|
|00000f00| 6f 20 62 65 20 50 61 73 | 63 61 6c 2d 63 6f 6d 70 |o be Pas|cal-comp|
|00000f10| 61 74 69 62 6c 65 2e 0d | 20 2a 2f 0d 0d 23 20 69 |atible..| */..# i|
|00000f20| 6e 63 6c 75 64 65 09 22 | 54 72 61 6e 73 53 6b 65 |nclude."|TransSke|
|00000f30| 6c 2e 68 22 0d 0d 23 20 | 69 6e 63 6c 75 64 65 09 |l.h"..# |include.|
|00000f40| 22 54 72 61 6e 73 45 64 | 69 74 2e 68 22 0d 0d 0d |"TransEd|it.h"...|
|00000f50| 23 20 64 65 66 69 6e 65 | 09 6e 6f 72 6d 61 6c 48 |# define|.normalH|
|00000f60| 69 6c 69 74 65 09 30 0d | 23 20 64 65 66 69 6e 65 |ilite.0.|# define|
|00000f70| 09 64 69 6d 48 69 6c 69 | 74 65 09 09 32 35 35 0d |.dimHili|te..255.|
|00000f80| 0d 2f 2a 0d 20 2a 20 4d | 61 78 69 6d 75 6d 20 73 |./*. * M|aximum s|
|00000f90| 69 7a 65 20 6f 66 20 66 | 69 6c 65 20 77 65 27 6c |ize of f|ile we'l|
|00000fa0| 6c 20 61 74 74 65 6d 70 | 74 20 74 6f 20 72 65 61 |l attemp|t to rea|
|00000fb0| 64 2e 20 20 54 68 65 20 | 76 61 6c 75 65 20 6c 65 |d. The |value le|
|00000fc0| 61 76 65 73 0d 20 2a 20 | 61 20 6c 69 74 74 6c 65 |aves. * |a little|
|00000fd0| 20 63 75 73 68 69 6f 6e | 20 61 67 61 69 6e 73 74 | cushion| against|
|00000fe0| 20 74 68 65 20 54 65 78 | 74 45 64 69 74 20 6c 69 | the Tex|tEdit li|
|00000ff0| 6d 69 74 20 6f 66 20 33 | 32 37 36 37 2e 0d 20 2a |mit of 3|2767.. *|
|00001000| 2f 0d 0d 23 20 64 65 66 | 69 6e 65 09 6d 61 78 46 |/..# def|ine.maxF|
|00001010| 69 6c 65 53 69 7a 65 09 | 09 33 32 30 30 30 0d 0d |ileSize.|.32000..|
|00001020| 0d 23 20 64 65 66 69 6e | 65 09 57 69 6e 64 6f 77 |.# defin|e.Window|
|00001030| 49 73 41 63 74 69 76 65 | 28 77 29 09 28 28 57 69 |IsActive|(w).((Wi|
|00001040| 6e 64 6f 77 50 65 65 6b | 29 20 28 77 29 29 2d 3e |ndowPeek|) (w))->|
|00001050| 68 69 6c 69 74 65 64 0d | 0d 0d 2f 2a 0d 20 2a 20 |hilited.|../*. * |
|00001060| 4e 65 77 28 54 79 70 65 | 4e 61 6d 65 29 20 72 65 |New(Type|Name) re|
|00001070| 74 75 72 6e 73 20 68 61 | 6e 64 6c 65 20 74 6f 20 |turns ha|ndle to |
|00001080| 6e 65 77 20 6f 62 6a 65 | 63 74 2c 20 66 6f 72 20 |new obje|ct, for |
|00001090| 61 6e 79 20 54 79 70 65 | 4e 61 6d 65 2e 0d 20 2a |any Type|Name.. *|
|000010a0| 20 49 66 20 74 68 65 72 | 65 20 69 73 20 69 6e 73 | If ther|e is ins|
|000010b0| 75 66 66 69 63 69 65 6e | 74 20 6d 65 6d 6f 72 79 |ufficien|t memory|
|000010c0| 2c 20 74 68 65 20 72 65 | 73 75 6c 74 20 69 73 20 |, the re|sult is |
|000010d0| 6e 69 6c 2e 0d 20 2a 2f | 0d 0d 23 20 64 65 66 69 |nil.. */|..# defi|
|000010e0| 6e 65 09 4e 65 77 28 74 | 79 70 65 29 09 28 74 79 |ne.New(t|ype).(ty|
|000010f0| 70 65 20 2a 2a 29 20 4e | 65 77 48 61 6e 64 6c 65 |pe **) N|ewHandle|
|00001100| 20 28 28 53 69 7a 65 29 | 20 73 69 7a 65 6f 66 20 | ((Size)| sizeof |
|00001110| 28 74 79 70 65 29 29 0d | 0d 0d 23 20 64 65 66 69 |(type)).|..# defi|
|00001120| 6e 65 09 65 6e 74 65 72 | 09 09 09 33 0d 23 20 64 |ne.enter|...3.# d|
|00001130| 65 66 69 6e 65 09 63 72 | 09 09 09 09 31 33 0d 0d |efine.cr|....13..|
|00001140| 0d 74 79 70 65 64 65 66 | 20 65 6e 75 6d 09 09 09 |.typedef| enum...|
|00001150| 2f 2a 20 45 64 69 74 20 | 6d 65 6e 75 20 69 74 65 |/* Edit |menu ite|
|00001160| 6d 20 6e 75 6d 62 65 72 | 73 20 2a 2f 0d 7b 0d 09 |m number|s */.{..|
|00001170| 75 6e 64 6f 20 3d 20 31 | 2c 0d 09 2f 2a 20 2d 2d |undo = 1|,../* --|
|00001180| 2d 20 2a 2f 0d 09 63 75 | 74 20 3d 20 33 2c 0d 09 |- */..cu|t = 3,..|
|00001190| 63 6f 70 79 2c 0d 09 70 | 61 73 74 65 2c 0d 09 63 |copy,..p|aste,..c|
|000011a0| 6c 65 61 72 09 09 2f 2a | 20 28 69 74 27 73 20 6f |lear../*| (it's o|
|000011b0| 6b 20 69 66 20 74 68 65 | 20 68 6f 73 74 20 64 6f |k if the| host do|
|000011c0| 65 73 6e 27 74 20 68 61 | 76 65 20 74 68 69 73 20 |esn't ha|ve this |
|000011d0| 69 74 65 6d 29 20 2a 2f | 0d 7d 3b 0d 0d 0d 2f 2a |item) */|.};.../*|
|000011e0| 0d 20 2a 20 44 65 66 61 | 75 6c 74 20 76 61 6c 75 |. * Defa|ult valu|
|000011f0| 65 73 20 66 6f 72 20 65 | 64 69 74 20 77 69 6e 64 |es for e|dit wind|
|00001200| 6f 77 20 74 65 78 74 20 | 64 69 73 70 6c 61 79 20 |ow text |display |
|00001210| 63 68 61 72 61 63 74 65 | 72 69 73 74 69 63 73 0d |characte|ristics.|
|00001220| 20 2a 20 61 6e 64 20 65 | 76 65 6e 74 20 6e 6f 74 | * and e|vent not|
|00001230| 69 66 69 63 61 74 69 6f | 6e 20 70 72 6f 63 65 64 |ificatio|n proced|
|00001240| 75 72 65 73 2e 20 20 55 | 73 65 64 20 77 68 65 6e |ures. U|sed when|
|00001250| 20 6e 65 77 20 65 64 69 | 74 20 77 69 6e 64 6f 77 | new edi|t window|
|00001260| 73 0d 20 2a 20 61 72 65 | 20 63 72 65 61 74 65 64 |s. * are| created|
|00001270| 2e 0d 20 2a 2f 0d 0d 73 | 74 61 74 69 63 20 73 68 |.. */..s|tatic sh|
|00001280| 6f 72 74 09 65 5f 66 6f | 6e 74 20 3d 20 6d 6f 6e |ort.e_fo|nt = mon|
|00001290| 61 63 6f 3b 09 09 09 09 | 2f 2a 20 64 65 66 61 75 |aco;....|/* defau|
|000012a0| 6c 74 20 66 6f 6e 74 20 | 20 20 20 20 20 20 20 20 |lt font | |
|000012b0| 20 20 20 20 20 20 20 20 | 2a 2f 0d 73 74 61 74 69 | |*/.stati|
|000012c0| 63 20 73 68 6f 72 74 09 | 65 5f 73 69 7a 65 20 3d |c short.|e_size =|
|000012d0| 20 39 3b 09 09 09 09 09 | 09 2f 2a 20 64 65 66 61 | 9;.....|./* defa|
|000012e0| 75 6c 74 20 70 6f 69 6e | 74 73 69 7a 65 20 20 20 |ult poin|tsize |
|000012f0| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 73 74 61 74 | | */.stat|
|00001300| 69 63 20 73 68 6f 72 74 | 09 65 5f 77 72 61 70 20 |ic short|.e_wrap |
|00001310| 3d 20 30 3b 09 09 09 09 | 09 09 2f 2a 20 64 65 66 |= 0;....|../* def|
|00001320| 61 75 6c 74 20 77 6f 72 | 64 20 77 72 61 70 20 28 |ault wor|d wrap (|
|00001330| 6f 6e 29 20 20 20 20 20 | 20 20 2a 2f 0d 73 74 61 |on) | */.sta|
|00001340| 74 69 63 20 73 68 6f 72 | 74 09 65 5f 6a 75 73 74 |tic shor|t.e_just|
|00001350| 20 3d 20 74 65 4a 75 73 | 74 4c 65 66 74 3b 09 09 | = teJus|tLeft;..|
|00001360| 09 2f 2a 20 64 65 66 61 | 75 6c 74 20 6a 75 73 74 |./* defa|ult just|
|00001370| 69 66 69 63 61 74 69 6f | 6e 20 20 20 20 20 20 20 |ificatio|n |
|00001380| 20 2a 2f 0d 73 74 61 74 | 69 63 20 54 45 64 69 74 | */.stat|ic TEdit|
|00001390| 4b 65 79 50 72 6f 63 50 | 74 72 09 09 65 5f 6b 65 |KeyProcP|tr..e_ke|
|000013a0| 79 20 3d 20 6e 69 6c 3b | 09 09 2f 2a 20 64 65 66 |y = nil;|../* def|
|000013b0| 61 75 6c 74 20 6b 65 79 | 20 70 72 6f 63 65 64 75 |ault key| procedu|
|000013c0| 72 65 20 20 20 20 20 20 | 20 20 2a 2f 0d 73 74 61 |re | */.sta|
|000013d0| 74 69 63 20 54 45 64 69 | 74 41 63 74 69 76 61 74 |tic TEdi|tActivat|
|000013e0| 65 50 72 6f 63 50 74 72 | 09 65 5f 61 63 74 69 76 |eProcPtr|.e_activ|
|000013f0| 61 74 65 20 3d 20 6e 69 | 6c 3b 09 2f 2a 20 64 65 |ate = ni|l;./* de|
|00001400| 66 61 75 6c 74 20 61 63 | 74 69 76 61 74 69 6f 6e |fault ac|tivation|
|00001410| 20 70 72 6f 63 65 64 75 | 72 65 20 2a 2f 0d 73 74 | procedu|re */.st|
|00001420| 61 74 69 63 20 54 45 64 | 69 74 43 6c 6f 73 65 50 |atic TEd|itCloseP|
|00001430| 72 6f 63 50 74 72 09 65 | 5f 63 6c 6f 73 65 20 3d |rocPtr.e|_close =|
|00001440| 20 6e 69 6c 3b 09 09 2f | 2a 20 64 65 66 61 75 6c | nil;../|* defaul|
|00001450| 74 20 63 6c 6f 73 65 20 | 70 72 6f 63 65 64 75 72 |t close |procedur|
|00001460| 65 20 20 20 20 20 20 2a | 2f 0d 0d 0d 2f 2a 0d 20 |e *|/.../*. |
|00001470| 2a 20 45 64 69 74 20 77 | 69 6e 64 6f 77 20 64 6f |* Edit w|indow do|
|00001480| 63 75 6d 65 6e 74 20 72 | 65 63 6f 72 64 2e 20 20 |cument r|ecord. |
|00001490| 41 20 68 61 6e 64 6c 65 | 20 74 6f 20 61 20 77 69 |A handle| to a wi|
|000014a0| 6e 64 6f 77 27 73 20 64 | 6f 63 75 6d 65 6e 74 0d |ndow's d|ocument.|
|000014b0| 20 2a 20 72 65 63 6f 72 | 64 20 69 73 20 73 74 6f | * recor|d is sto|
|000014c0| 72 65 64 20 69 6e 20 74 | 68 65 20 77 69 6e 64 6f |red in t|he windo|
|000014d0| 77 27 73 20 70 72 6f 70 | 65 72 74 79 20 6c 69 73 |w's prop|erty lis|
|000014e0| 74 2e 0d 20 2a 2f 0d 0d | 74 79 70 65 64 65 66 20 |t.. */..|typedef |
|000014f0| 73 74 72 75 63 74 20 44 | 6f 63 52 65 63 6f 72 64 |struct D|ocRecord|
|00001500| 09 44 6f 63 52 65 63 6f | 72 64 2c 20 2a 44 6f 63 |.DocReco|rd, *Doc|
|00001510| 50 74 72 2c 20 2a 2a 44 | 6f 63 48 61 6e 64 6c 65 |Ptr, **D|ocHandle|
|00001520| 3b 0d 0d 73 74 72 75 63 | 74 20 44 6f 63 52 65 63 |;..struc|t DocRec|
|00001530| 6f 72 64 0d 7b 0d 09 57 | 69 6e 64 6f 77 50 74 72 |ord.{..W|indowPtr|
|00001540| 09 09 65 64 69 74 57 69 | 6e 64 3b 09 2f 2a 20 74 |..editWi|nd;./* t|
|00001550| 68 65 20 65 64 69 74 20 | 77 69 6e 64 6f 77 20 20 |he edit |window |
|00001560| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001570| 20 2a 2f 0d 09 42 6f 6f | 6c 65 61 6e 09 09 09 62 | */..Boo|lean...b|
|00001580| 6f 75 6e 64 3b 09 09 2f | 2a 20 77 68 65 74 68 65 |ound;../|* whethe|
|00001590| 72 20 77 69 6e 64 6f 77 | 20 69 73 20 62 6f 75 6e |r window| is boun|
|000015a0| 64 20 74 6f 20 66 69 6c | 65 20 20 20 2a 2f 0d 09 |d to fil|e */..|
|000015b0| 53 46 52 65 70 6c 79 09 | 09 09 65 64 69 74 46 69 |SFReply.|..editFi|
|000015c0| 6c 65 3b 09 2f 2a 20 66 | 69 6c 65 20 69 74 27 73 |le;./* f|ile it's|
|000015d0| 20 62 6f 75 6e 64 20 74 | 6f 2c 20 69 66 20 62 6f | bound t|o, if bo|
|000015e0| 75 6e 64 20 74 72 75 65 | 20 2a 2f 0d 09 54 45 48 |und true| */..TEH|
|000015f0| 61 6e 64 6c 65 09 09 65 | 64 69 74 54 45 3b 09 09 |andle..e|ditTE;..|
|00001600| 2f 2a 20 77 69 6e 64 6f | 77 20 74 65 78 74 20 20 |/* windo|w text |
|00001610| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001620| 20 20 20 20 20 2a 2f 0d | 09 42 6f 6f 6c 65 61 6e | */.|.Boolean|
|00001630| 09 09 09 64 69 72 74 79 | 3b 09 09 2f 2a 20 77 68 |...dirty|;../* wh|
|00001640| 65 74 68 65 72 20 74 65 | 78 74 20 6d 6f 64 69 66 |ether te|xt modif|
|00001650| 69 65 64 20 73 69 6e 63 | 65 20 73 61 76 65 20 20 |ied sinc|e save |
|00001660| 2a 2f 0d 09 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |*/..Cont|rolHandl|
|00001670| 65 09 65 53 63 72 6f 6c | 6c 3b 09 2f 2a 20 73 63 |e.eScrol|l;./* sc|
|00001680| 72 6f 6c 6c 20 62 61 72 | 20 20 20 20 20 20 20 20 |roll bar| |
|00001690| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000016a0| 2a 2f 0d 09 73 68 6f 72 | 74 09 09 09 76 69 73 4c |*/..shor|t...visL|
|000016b0| 69 6e 65 73 3b 09 2f 2a | 20 23 20 6c 69 6e 65 73 |ines;./*| # lines|
|000016c0| 20 76 69 73 69 62 6c 65 | 20 69 6e 20 77 69 6e 64 | visible| in wind|
|000016d0| 6f 77 2c 20 6d 61 78 20 | 20 20 20 2a 2f 0d 09 54 |ow, max | */..T|
|000016e0| 45 64 69 74 4b 65 79 50 | 72 6f 63 50 74 72 09 09 |EditKeyP|rocPtr..|
|000016f0| 09 65 4b 65 79 3b 09 09 | 2f 2a 20 6b 65 79 20 63 |.eKey;..|/* key c|
|00001700| 6c 69 63 6b 20 6e 6f 74 | 69 66 69 65 72 20 20 20 |lick not|ifier |
|00001710| 20 20 20 20 20 2a 2f 0d | 09 54 45 64 69 74 41 63 | */.|.TEditAc|
|00001720| 74 69 76 61 74 65 50 72 | 6f 63 50 74 72 09 65 41 |tivatePr|ocPtr.eA|
|00001730| 63 74 69 76 61 74 65 3b | 09 2f 2a 20 61 63 74 69 |ctivate;|./* acti|
|00001740| 76 61 74 65 20 65 76 65 | 6e 74 20 6e 6f 74 69 66 |vate eve|nt notif|
|00001750| 69 65 72 20 20 20 2a 2f | 0d 09 54 45 64 69 74 43 |ier */|..TEditC|
|00001760| 6c 6f 73 65 50 72 6f 63 | 50 74 72 09 09 65 43 6c |loseProc|Ptr..eCl|
|00001770| 6f 73 65 3b 09 09 2f 2a | 20 63 6c 6f 73 65 20 6e |ose;../*| close n|
|00001780| 6f 74 69 66 69 65 72 20 | 20 20 20 20 20 20 20 20 |otifier | |
|00001790| 20 20 20 2a 2f 0d 7d 3b | 0d 0d 0d 2f 2a 0d 20 2a | */.};|.../*. *|
|000017a0| 20 4d 61 63 72 6f 73 20 | 66 6f 72 20 61 63 63 65 | Macros |for acce|
|000017b0| 73 73 69 6e 67 20 70 61 | 72 74 73 20 6f 66 20 61 |ssing pa|rts of a|
|000017c0| 20 64 6f 63 75 6d 65 6e | 74 20 72 65 63 6f 72 64 | documen|t record|
|000017d0| 2c 20 67 69 76 65 6e 20 | 61 20 64 6f 63 75 6d 65 |, given |a docume|
|000017e0| 6e 74 0d 20 2a 20 68 61 | 6e 64 6c 65 2e 0d 20 2a |nt. * ha|ndle.. *|
|000017f0| 2f 0d 0d 23 20 64 65 66 | 69 6e 65 09 44 6f 63 57 |/..# def|ine.DocW|
|00001800| 69 6e 64 28 64 6f 63 29 | 09 09 09 28 28 2a 2a 64 |ind(doc)|...((**d|
|00001810| 6f 63 29 2e 65 64 69 74 | 57 69 6e 64 29 0d 23 20 |oc).edit|Wind).# |
|00001820| 64 65 66 69 6e 65 09 44 | 6f 63 42 6f 75 6e 64 28 |define.D|ocBound(|
|00001830| 64 6f 63 29 09 09 09 28 | 28 2a 2a 64 6f 63 29 2e |doc)...(|(**doc).|
|00001840| 62 6f 75 6e 64 29 0d 23 | 20 64 65 66 69 6e 65 09 |bound).#| define.|
|00001850| 44 6f 63 46 69 6c 65 28 | 64 6f 63 29 09 09 09 28 |DocFile(|doc)...(|
|00001860| 28 2a 2a 64 6f 63 29 2e | 65 64 69 74 46 69 6c 65 |(**doc).|editFile|
|00001870| 29 0d 23 20 64 65 66 69 | 6e 65 09 44 6f 63 54 45 |).# defi|ne.DocTE|
|00001880| 28 64 6f 63 29 09 09 09 | 09 28 28 2a 2a 64 6f 63 |(doc)...|.((**doc|
|00001890| 29 2e 65 64 69 74 54 45 | 29 0d 23 20 64 65 66 69 |).editTE|).# defi|
|000018a0| 6e 65 09 44 6f 63 44 69 | 72 74 79 28 64 6f 63 29 |ne.DocDi|rty(doc)|
|000018b0| 09 09 09 28 28 2a 2a 64 | 6f 63 29 2e 64 69 72 74 |...((**d|oc).dirt|
|000018c0| 79 29 0d 23 20 64 65 66 | 69 6e 65 09 44 6f 63 53 |y).# def|ine.DocS|
|000018d0| 63 72 6f 6c 6c 28 64 6f | 63 29 09 09 09 28 28 2a |croll(do|c)...((*|
|000018e0| 2a 64 6f 63 29 2e 65 53 | 63 72 6f 6c 6c 29 0d 23 |*doc).eS|croll).#|
|000018f0| 20 64 65 66 69 6e 65 09 | 44 6f 63 56 69 73 4c 69 | define.|DocVisLi|
|00001900| 6e 65 73 28 64 6f 63 29 | 09 09 28 28 2a 2a 64 6f |nes(doc)|..((**do|
|00001910| 63 29 2e 76 69 73 4c 69 | 6e 65 73 29 0d 23 20 64 |c).visLi|nes).# d|
|00001920| 65 66 69 6e 65 09 44 6f | 63 4b 65 79 50 72 6f 63 |efine.Do|cKeyProc|
|00001930| 28 64 6f 63 29 09 09 09 | 28 28 2a 2a 64 6f 63 29 |(doc)...|((**doc)|
|00001940| 2e 65 4b 65 79 29 0d 23 | 20 64 65 66 69 6e 65 09 |.eKey).#| define.|
|00001950| 44 6f 63 41 63 74 69 76 | 61 74 65 50 72 6f 63 28 |DocActiv|ateProc(|
|00001960| 64 6f 63 29 09 28 28 2a | 2a 64 6f 63 29 2e 65 41 |doc).((*|*doc).eA|
|00001970| 63 74 69 76 61 74 65 29 | 0d 23 20 64 65 66 69 6e |ctivate)|.# defin|
|00001980| 65 09 44 6f 63 43 6c 6f | 73 65 50 72 6f 63 28 64 |e.DocClo|seProc(d|
|00001990| 6f 63 29 09 09 28 28 2a | 2a 64 6f 63 29 2e 65 43 |oc)..((*|*doc).eC|
|000019a0| 6c 6f 73 65 29 0d 0d 0d | 73 74 61 74 69 63 20 50 |lose)...|static P|
|000019b0| 6f 69 6e 74 09 64 6c 6f | 67 57 68 65 72 65 20 3d |oint.dlo|gWhere =|
|000019c0| 20 7b 20 37 30 2c 20 31 | 30 30 20 7d 3b 09 2f 2a | { 70, 1|00 };./*|
|000019d0| 20 47 65 74 46 69 6c 65 | 2f 50 75 74 46 69 6c 65 | GetFile|/PutFile|
|000019e0| 20 6c 6f 63 61 74 69 6f | 6e 20 2a 2f 0d 73 74 61 | locatio|n */.sta|
|000019f0| 74 69 63 20 4f 53 54 79 | 70 65 09 63 72 65 61 74 |tic OSTy|pe.creat|
|00001a00| 6f 72 20 3d 20 27 54 45 | 44 54 27 3b 09 09 09 2f |or = 'TE|DT';.../|
|00001a10| 2a 20 64 65 66 61 75 6c | 74 20 66 69 6c 65 20 63 |* defaul|t file c|
|00001a20| 72 65 61 74 6f 72 20 2a | 2f 0d 0d 73 74 61 74 69 |reator *|/..stati|
|00001a30| 63 20 52 67 6e 48 61 6e | 64 6c 65 09 63 6c 69 70 |c RgnHan|dle.clip|
|00001a40| 52 67 6e 20 3d 20 28 52 | 67 6e 48 61 6e 64 6c 65 |Rgn = (R|gnHandle|
|00001a50| 29 20 6e 69 6c 3b 0d 0d | 0d 2f 2a 20 2d 2d 2d 2d |) nil;..|./* ----|
|00001a60| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a90| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001aa0| 20 2a 2f 0d 2f 2a 09 09 | 09 09 4d 69 73 63 65 6c | */./*..|..Miscel|
|00001ab0| 6c 61 6e 65 6f 75 73 20 | 49 6e 74 65 72 6e 61 6c |laneous |Internal|
|00001ac0| 20 28 70 72 69 76 61 74 | 65 29 20 52 6f 75 74 69 | (privat|e) Routi|
|00001ad0| 6e 65 73 09 09 09 09 2a | 2f 0d 2f 2a 20 2d 2d 2d |nes....*|/./* ---|
|00001ae0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001af0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001b00| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001b10| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001b20| 2d 20 2a 2f 0d 0d 0d 73 | 74 61 74 69 63 20 76 6f |- */...s|tatic vo|
|00001b30| 69 64 0d 45 72 72 4d 65 | 73 67 20 28 53 74 72 69 |id.ErrMe|sg (Stri|
|00001b40| 6e 67 50 74 72 20 73 29 | 0d 7b 0d 09 28 76 6f 69 |ngPtr s)|.{..(voi|
|00001b50| 64 29 20 46 61 6b 65 41 | 6c 65 72 74 20 28 73 2c |d) FakeA|lert (s,|
|00001b60| 20 22 5c 70 22 2c 20 22 | 5c 70 22 2c 20 22 5c 70 | "\p", "|\p", "\p|
|00001b70| 22 2c 20 31 2c 20 31 2c | 20 30 2c 20 22 5c 70 4f |", 1, 1,| 0, "\pO|
|00001b80| 4b 22 2c 20 22 5c 70 22 | 2c 20 22 5c 70 22 29 3b |K", "\p"|, "\p");|
|00001b90| 0d 7d 0d 0d 0d 2f 2a 0d | 20 2a 20 53 61 76 65 20 |.}.../*.| * Save |
|00001ba0| 61 6e 64 20 72 65 73 74 | 6f 72 65 20 74 68 65 20 |and rest|ore the |
|00001bb0| 63 75 72 72 65 6e 74 20 | 77 69 6e 64 6f 77 27 73 |current |window's|
|00001bc0| 20 63 6c 69 70 20 72 65 | 67 69 6f 6e 0d 20 2a 2f | clip re|gion. */|
|00001bd0| 0d 0d 73 74 61 74 69 63 | 20 76 6f 69 64 0d 53 61 |..static| void.Sa|
|00001be0| 76 65 43 6c 69 70 52 67 | 6e 20 28 76 6f 69 64 29 |veClipRg|n (void)|
|00001bf0| 0d 7b 0d 09 63 6c 69 70 | 52 67 6e 20 3d 20 4e 65 |.{..clip|Rgn = Ne|
|00001c00| 77 52 67 6e 20 28 29 3b | 0d 09 47 65 74 43 6c 69 |wRgn ();|..GetCli|
|00001c10| 70 20 28 63 6c 69 70 52 | 67 6e 29 3b 0d 7d 0d 0d |p (clipR|gn);.}..|
|00001c20| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 0d 52 65 73 |.static |void.Res|
|00001c30| 74 6f 72 65 43 6c 69 70 | 52 67 6e 20 28 76 6f 69 |toreClip|Rgn (voi|
|00001c40| 64 29 0d 7b 0d 09 53 65 | 74 43 6c 69 70 20 28 63 |d).{..Se|tClip (c|
|00001c50| 6c 69 70 52 67 6e 29 3b | 0d 09 44 69 73 70 6f 73 |lipRgn);|..Dispos|
|00001c60| 65 52 67 6e 20 28 63 6c | 69 70 52 67 6e 29 3b 0d |eRgn (cl|ipRgn);.|
|00001c70| 7d 0d 0d 0d 2f 2a 0d 20 | 2a 20 44 72 61 77 20 67 |}.../*. |* Draw g|
|00001c80| 72 6f 77 20 62 6f 78 20 | 69 6e 20 6c 6f 77 65 72 |row box |in lower|
|00001c90| 20 72 69 67 68 74 20 68 | 61 6e 64 20 63 6f 72 6e | right h|and corn|
|00001ca0| 65 72 20 6f 66 20 77 69 | 6e 64 6f 77 2e 0d 20 2a |er of wi|ndow.. *|
|00001cb0| 2f 0d 0d 73 74 61 74 69 | 63 20 76 6f 69 64 0d 44 |/..stati|c void.D|
|00001cc0| 72 61 77 47 72 6f 77 42 | 6f 78 20 28 57 69 6e 64 |rawGrowB|ox (Wind|
|00001cd0| 6f 77 50 74 72 20 77 29 | 0d 7b 0d 52 65 63 74 09 |owPtr w)|.{.Rect.|
|00001ce0| 72 3b 0d 0d 09 53 61 76 | 65 43 6c 69 70 52 67 6e |r;...Sav|eClipRgn|
|00001cf0| 20 28 29 3b 0d 09 72 20 | 3d 20 77 2d 3e 70 6f 72 | ();..r |= w->por|
|00001d00| 74 52 65 63 74 3b 0d 09 | 72 2e 6c 65 66 74 20 3d |tRect;..|r.left =|
|00001d10| 20 72 2e 72 69 67 68 74 | 20 2d 20 31 35 3b 09 09 | r.right| - 15;..|
|00001d20| 2f 2a 20 64 72 61 77 20 | 6f 6e 6c 79 20 69 6e 20 |/* draw |only in |
|00001d30| 63 6f 72 6e 65 72 20 2a | 2f 0d 09 72 2e 74 6f 70 |corner *|/..r.top|
|00001d40| 20 3d 20 72 2e 62 6f 74 | 74 6f 6d 20 2d 20 31 35 | = r.bot|tom - 15|
|00001d50| 3b 0d 09 43 6c 69 70 52 | 65 63 74 20 28 26 72 29 |;..ClipR|ect (&r)|
|00001d60| 3b 0d 09 44 72 61 77 47 | 72 6f 77 49 63 6f 6e 20 |;..DrawG|rowIcon |
|00001d70| 28 77 29 3b 0d 09 52 65 | 73 74 6f 72 65 43 6c 69 |(w);..Re|storeCli|
|00001d80| 70 52 67 6e 20 28 29 3b | 0d 7d 0d 0d 0d 2f 2a 0d |pRgn ();|.}.../*.|
|00001d90| 20 2a 20 47 65 6e 65 72 | 61 74 65 20 74 69 74 6c | * Gener|ate titl|
|00001da0| 65 20 66 6f 72 20 6e 65 | 77 20 75 6e 74 69 74 6c |e for ne|w untitl|
|00001db0| 65 64 20 64 6f 63 75 6d | 65 6e 74 2e 20 20 46 69 |ed docum|ent. Fi|
|00001dc0| 72 73 74 20 6f 6e 65 20 | 69 73 0d 20 2a 20 75 6e |rst one |is. * un|
|00001dd0| 6e 75 6d 62 65 72 65 64 | 2c 20 6f 74 68 65 72 73 |numbered|, others|
|00001de0| 20 61 72 65 20 6e 75 6d | 62 65 72 65 64 2e 0d 20 | are num|bered.. |
|00001df0| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 76 6f 69 64 0d |*/..stat|ic void.|
|00001e00| 55 6e 74 69 74 6c 65 64 | 20 28 53 74 72 69 6e 67 |Untitled| (String|
|00001e10| 50 74 72 09 6e 61 6d 65 | 29 0d 7b 0d 73 74 61 74 |Ptr.name|).{.stat|
|00001e20| 69 63 20 6c 6f 6e 67 09 | 6e 75 6d 20 3d 20 30 3b |ic long.|num = 0;|
|00001e30| 0d 53 74 72 32 35 35 09 | 09 6e 75 6d 42 75 66 3b |.Str255.|.numBuf;|
|00001e40| 0d 0d 09 42 6c 6f 63 6b | 4d 6f 76 65 20 28 22 5c |...Block|Move ("\|
|00001e50| 70 75 6e 74 69 74 6c 65 | 64 22 2c 20 6e 61 6d 65 |puntitle|d", name|
|00001e60| 2c 20 39 4c 29 3b 0d 09 | 69 66 20 28 2b 2b 6e 75 |, 9L);..|if (++nu|
|00001e70| 6d 20 3e 20 31 29 0d 09 | 7b 0d 09 09 6e 61 6d 65 |m > 1)..|{...name|
|00001e80| 5b 2b 2b 6e 61 6d 65 5b | 30 5d 5d 20 3d 20 27 20 |[++name[|0]] = ' |
|00001e90| 27 3b 0d 09 09 4e 75 6d | 54 6f 53 74 72 69 6e 67 |';...Num|ToString|
|00001ea0| 20 28 6e 75 6d 2c 20 6e | 75 6d 42 75 66 29 3b 0d | (num, n|umBuf);.|
|00001eb0| 09 09 42 6c 6f 63 6b 4d | 6f 76 65 20 28 26 6e 75 |..BlockM|ove (&nu|
|00001ec0| 6d 42 75 66 5b 31 5d 2c | 20 26 6e 61 6d 65 5b 6e |mBuf[1],| &name[n|
|00001ed0| 61 6d 65 5b 30 5d 2b 31 | 5d 2c 20 28 6c 6f 6e 67 |ame[0]+1|], (long|
|00001ee0| 29 20 6e 75 6d 42 75 66 | 5b 30 5d 29 3b 0d 09 09 |) numBuf|[0]);...|
|00001ef0| 6e 61 6d 65 5b 30 5d 20 | 2b 3d 20 6e 75 6d 42 75 |name[0] |+= numBu|
|00001f00| 66 5b 30 5d 3b 0d 09 7d | 0d 7d 0d 0d 0d 2f 2a 20 |f[0];..}|.}.../* |
|00001f10| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001f20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001f30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001f40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001f50| 2d 2d 2d 2d 20 2a 2f 0d | 2f 2a 09 09 09 4c 6f 77 |---- */.|/*...Low|
|00001f60| 65 73 74 2d 6c 65 76 65 | 6c 20 49 6e 74 65 72 6e |est-leve|l Intern|
|00001f70| 61 6c 20 28 50 72 69 76 | 61 74 65 29 20 45 64 69 |al (Priv|ate) Edi|
|00001f80| 74 20 57 69 6e 64 6f 77 | 20 52 6f 75 74 69 6e 65 |t Window| Routine|
|00001f90| 73 09 09 2a 2f 0d 2f 2a | 20 2d 2d 2d 2d 2d 2d 2d |s..*/./*| -------|
|00001fa0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001fb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001fc0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001fd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 20 2a 2f |--------|----- */|
|00001fe0| 0d 0d 0d 2f 2a 0d 20 2a | 20 47 65 74 20 64 6f 63 |.../*. *| Get doc|
|00001ff0| 75 6d 65 6e 74 20 68 61 | 6e 64 6c 65 20 61 73 73 |ument ha|ndle ass|
|00002000| 6f 63 69 61 74 65 64 20 | 77 69 74 68 20 65 64 69 |ociated |with edi|
|00002010| 74 20 77 69 6e 64 6f 77 | 2e 0d 20 2a 20 52 65 74 |t window|.. * Ret|
|00002020| 75 72 6e 20 6e 69 6c 20 | 69 66 20 77 69 6e 64 6f |urn nil |if windo|
|00002030| 77 20 69 73 6e 27 74 20 | 61 20 6b 6e 6f 77 6e 20 |w isn't |a known |
|00002040| 65 64 69 74 20 77 69 6e | 64 6f 77 2e 0d 20 2a 2f |edit win|dow.. */|
|00002050| 0d 0d 73 74 61 74 69 63 | 20 44 6f 63 48 61 6e 64 |..static| DocHand|
|00002060| 6c 65 0d 57 69 6e 64 44 | 6f 63 48 61 6e 64 6c 65 |le.WindD|ocHandle|
|00002070| 20 28 57 69 6e 64 6f 77 | 50 74 72 20 77 29 0d 7b | (Window|Ptr w).{|
|00002080| 0d 53 6b 65 6c 57 69 6e | 64 50 72 6f 70 48 61 6e |.SkelWin|dPropHan|
|00002090| 64 6c 65 09 70 68 3b 0d | 44 6f 63 48 61 6e 64 6c |dle.ph;.|DocHandl|
|000020a0| 65 09 64 6f 63 20 3d 20 | 28 44 6f 63 48 61 6e 64 |e.doc = |(DocHand|
|000020b0| 6c 65 29 20 6e 69 6c 3b | 0d 0d 09 69 66 20 28 77 |le) nil;|...if (w|
|000020c0| 20 21 3d 20 28 57 69 6e | 64 6f 77 50 74 72 29 20 | != (Win|dowPtr) |
|000020d0| 6e 69 6c 29 0d 09 7b 0d | 09 09 70 68 20 3d 20 53 |nil)..{.|..ph = S|
|000020e0| 6b 65 6c 47 65 74 57 69 | 6e 64 50 72 6f 70 20 28 |kelGetWi|ndProp (|
|000020f0| 77 2c 20 73 6b 65 6c 57 | 50 72 6f 70 45 64 69 74 |w, skelW|PropEdit|
|00002100| 57 69 6e 64 29 3b 0d 09 | 09 69 66 20 28 70 68 20 |Wind);..|.if (ph |
|00002110| 21 3d 20 28 53 6b 65 6c | 57 69 6e 64 50 72 6f 70 |!= (Skel|WindProp|
|00002120| 48 61 6e 64 6c 65 29 20 | 6e 69 6c 29 0d 09 09 09 |Handle) |nil)....|
|00002130| 64 6f 63 20 3d 20 28 44 | 6f 63 48 61 6e 64 6c 65 |doc = (D|ocHandle|
|00002140| 29 20 28 2a 2a 70 68 29 | 2e 73 6b 65 6c 57 50 72 |) (**ph)|.skelWPr|
|00002150| 6f 70 44 61 74 61 3b 0d | 09 7d 0d 09 72 65 74 75 |opData;.|.}..retu|
|00002160| 72 6e 20 28 64 6f 63 29 | 3b 0d 7d 0d 0d 0d 2f 2a |rn (doc)|;.}.../*|
|00002170| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | -------|--------|
|00002180| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002190| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000021a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000021b0| 2d 2d 2d 2d 2d 20 2a 2f | 0d 2f 2a 09 09 09 09 09 |----- */|./*.....|
|000021c0| 49 6e 74 65 72 6e 61 6c | 20 28 70 72 69 76 61 74 |Internal| (privat|
|000021d0| 65 29 20 44 69 73 70 6c | 61 79 20 52 6f 75 74 69 |e) Displ|ay Routi|
|000021e0| 6e 65 73 09 09 09 09 09 | 2a 2f 0d 2f 2a 20 2d 2d |nes.....|*/./* --|
|000021f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002200| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002210| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002220| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002230| 2d 2d 20 2a 2f 0d 0d 0d | 2f 2a 0d 20 2a 20 43 61 |-- */...|/*. * Ca|
|00002240| 6c 63 75 6c 61 74 65 20 | 74 68 65 20 64 69 6d 65 |lculate |the dime|
|00002250| 6e 73 69 6f 6e 73 20 6f | 66 20 74 68 65 20 65 64 |nsions o|f the ed|
|00002260| 69 74 69 6e 67 20 72 65 | 63 74 61 6e 67 6c 65 20 |iting re|ctangle |
|00002270| 66 6f 72 20 61 20 77 69 | 6e 64 6f 77 0d 20 2a 20 |for a wi|ndow. * |
|00002280| 28 77 68 69 63 68 20 69 | 73 20 61 73 73 75 6d 65 |(which i|s assume|
|00002290| 64 20 74 6f 20 62 65 20 | 74 68 65 20 63 75 72 72 |d to be |the curr|
|000022a0| 65 6e 74 20 70 6f 72 74 | 29 2e 20 20 28 54 68 65 |ent port|). (The|
|000022b0| 20 76 69 65 77 52 65 63 | 74 20 61 6e 64 0d 20 2a | viewRec|t and. *|
|000022c0| 20 64 65 73 74 52 65 63 | 74 20 61 72 65 20 74 68 | destRec|t are th|
|000022d0| 65 20 73 61 6d 65 20 73 | 69 7a 65 2e 29 20 20 41 |e same s|ize.) A|
|000022e0| 73 73 75 6d 65 73 20 74 | 68 65 20 70 6f 72 74 2c |ssumes t|he port,|
|000022f0| 20 74 65 78 74 20 66 6f | 6e 74 20 61 6e 64 0d 20 | text fo|nt and. |
|00002300| 2a 20 74 65 78 74 20 73 | 69 7a 65 20 61 72 65 20 |* text s|ize are |
|00002310| 61 6c 6c 20 73 65 74 20 | 70 72 6f 70 65 72 6c 79 |all set |properly|
|00002320| 2e 20 20 54 68 65 20 76 | 69 65 77 52 65 63 74 20 |. The v|iewRect |
|00002330| 69 73 20 73 69 7a 65 64 | 20 73 6f 20 74 68 61 74 |is sized| so that|
|00002340| 0d 20 2a 20 61 6e 20 69 | 6e 74 65 67 72 61 6c 20 |. * an i|ntegral |
|00002350| 6e 75 6d 62 65 72 20 6f | 66 20 6c 69 6e 65 73 20 |number o|f lines |
|00002360| 63 61 6e 20 62 65 20 64 | 69 73 70 6c 61 79 65 64 |can be d|isplayed|
|00002370| 20 69 6e 20 69 74 2c 20 | 69 2e 65 2e 2c 20 73 6f | in it, |i.e., so|
|00002380| 20 74 68 61 74 0d 20 2a | 20 61 20 70 61 72 74 69 | that. *| a parti|
|00002390| 61 6c 20 6c 69 6e 65 20 | 6e 65 76 65 72 20 73 68 |al line |never sh|
|000023a0| 6f 77 73 20 61 74 20 74 | 68 65 20 62 6f 74 74 6f |ows at t|he botto|
|000023b0| 6d 2e 20 20 49 66 20 74 | 68 61 74 27 73 20 6e 6f |m. If t|hat's no|
|000023c0| 74 20 64 6f 6e 65 2c 0d | 20 2a 20 66 75 6e 6e 79 |t done,.| * funny|
|000023d0| 20 74 68 69 6e 67 73 20 | 63 61 6e 20 68 61 70 70 | things |can happ|
|000023e0| 65 6e 20 74 6f 20 74 68 | 65 20 63 61 72 65 74 2e |en to th|e caret.|
|000023f0| 0d 20 2a 2f 0d 0d 73 74 | 61 74 69 63 20 76 6f 69 |. */..st|atic voi|
|00002400| 64 0d 43 61 6c 63 45 64 | 69 74 52 65 63 74 20 28 |d.CalcEd|itRect (|
|00002410| 57 69 6e 64 6f 77 50 74 | 72 20 77 2c 20 52 65 63 |WindowPt|r w, Rec|
|00002420| 74 20 2a 72 29 0d 7b 0d | 46 6f 6e 74 49 6e 66 6f |t *r).{.|FontInfo|
|00002430| 09 66 3b 0d 73 68 6f 72 | 74 09 09 6c 69 6e 65 48 |.f;.shor|t..lineH|
|00002440| 65 69 67 68 74 3b 0d 0d | 09 47 65 74 46 6f 6e 74 |eight;..|.GetFont|
|00002450| 49 6e 66 6f 20 28 26 66 | 29 3b 0d 09 6c 69 6e 65 |Info (&f|);..line|
|00002460| 48 65 69 67 68 74 20 3d | 20 66 2e 61 73 63 65 6e |Height =| f.ascen|
|00002470| 74 20 2b 20 66 2e 64 65 | 73 63 65 6e 74 20 2b 20 |t + f.de|scent + |
|00002480| 66 2e 6c 65 61 64 69 6e | 67 3b 0d 09 2a 72 20 3d |f.leadin|g;..*r =|
|00002490| 20 77 2d 3e 70 6f 72 74 | 52 65 63 74 3b 0d 09 72 | w->port|Rect;..r|
|000024a0| 2d 3e 6c 65 66 74 20 2b | 3d 20 34 3b 0d 09 72 2d |->left +|= 4;..r-|
|000024b0| 3e 72 69 67 68 74 20 2d | 3d 20 31 37 3b 09 09 09 |>right -|= 17;...|
|000024c0| 2f 2a 20 6c 65 61 76 65 | 20 72 6f 6f 6d 20 66 6f |/* leave| room fo|
|000024d0| 72 20 73 63 72 6f 6c 6c | 20 62 61 72 20 2b 20 32 |r scroll| bar + 2|
|000024e0| 20 2a 2f 0d 09 72 2d 3e | 74 6f 70 20 2b 3d 20 32 | */..r->|top += 2|
|000024f0| 3b 0d 09 72 2d 3e 62 6f | 74 74 6f 6d 20 3d 20 72 |;..r->bo|ttom = r|
|00002500| 2d 3e 74 6f 70 20 2b 20 | 28 28 72 2d 3e 62 6f 74 |->top + |((r->bot|
|00002510| 74 6f 6d 20 2d 20 72 2d | 3e 74 6f 70 20 2d 20 32 |tom - r-|>top - 2|
|00002520| 29 20 2f 20 6c 69 6e 65 | 48 65 69 67 68 74 29 20 |) / line|Height) |
|00002530| 2a 20 6c 69 6e 65 48 65 | 69 67 68 74 3b 0d 7d 0d |* lineHe|ight;.}.|
|00002540| 0d 0d 2f 2a 0d 20 2a 20 | 43 61 6c 63 75 6c 61 74 |../*. * |Calculat|
|00002550| 65 20 74 68 65 20 64 69 | 6d 65 6e 73 69 6f 6e 73 |e the di|mensions|
|00002560| 20 6f 66 20 74 68 65 20 | 73 63 72 6f 6c 6c 20 62 | of the |scroll b|
|00002570| 61 72 20 72 65 63 74 61 | 6e 67 6c 65 20 66 6f 72 |ar recta|ngle for|
|00002580| 20 61 0d 20 2a 20 77 69 | 6e 64 6f 77 2e 20 20 4d | a. * wi|ndow. M|
|00002590| 61 6b 65 20 73 75 72 65 | 20 74 68 61 74 20 74 68 |ake sure| that th|
|000025a0| 65 20 65 64 67 65 73 20 | 6f 76 65 72 6c 61 70 20 |e edges |overlap |
|000025b0| 74 68 65 20 77 69 6e 64 | 6f 77 20 66 72 61 6d 65 |the wind|ow frame|
|000025c0| 20 61 6e 64 0d 20 2a 20 | 74 68 65 20 67 72 6f 77 | and. * |the grow|
|000025d0| 20 62 6f 78 2e 0d 20 2a | 2f 0d 0d 73 74 61 74 69 | box.. *|/..stati|
|000025e0| 63 20 76 6f 69 64 0d 43 | 61 6c 63 53 63 72 6f 6c |c void.C|alcScrol|
|000025f0| 6c 52 65 63 74 20 28 57 | 69 6e 64 6f 77 50 74 72 |lRect (W|indowPtr|
|00002600| 20 77 2c 20 52 65 63 74 | 20 2a 72 29 0d 7b 0d 09 | w, Rect| *r).{..|
|00002610| 2a 72 20 3d 20 77 2d 3e | 70 6f 72 74 52 65 63 74 |*r = w->|portRect|
|00002620| 3b 0d 09 2b 2b 72 2d 3e | 72 69 67 68 74 3b 0d 09 |;..++r->|right;..|
|00002630| 2d 2d 72 2d 3e 74 6f 70 | 3b 0d 09 72 2d 3e 6c 65 |--r->top|;..r->le|
|00002640| 66 74 20 3d 20 72 2d 3e | 72 69 67 68 74 20 2d 20 |ft = r->|right - |
|00002650| 31 36 3b 0d 09 72 2d 3e | 62 6f 74 74 6f 6d 20 2d |16;..r->|bottom -|
|00002660| 3d 20 31 34 3b 0d 7d 0d | 0d 0d 2f 2a 0d 20 2a 20 |= 14;.}.|../*. * |
|00002670| 52 65 74 75 72 6e 20 74 | 72 75 65 20 69 66 20 74 |Return t|rue if t|
|00002680| 68 65 20 6d 6f 75 73 65 | 20 69 73 20 69 6e 20 74 |he mouse| is in t|
|00002690| 68 65 20 6e 6f 6e 2d 73 | 63 72 6f 6c 6c 62 61 72 |he non-s|crollbar|
|000026a0| 20 70 61 72 74 20 6f 66 | 20 61 6e 0d 20 2a 20 65 | part of| an. * e|
|000026b0| 64 69 74 20 77 69 6e 64 | 6f 77 2e 0d 20 2a 2f 0d |dit wind|ow.. */.|
|000026c0| 0d 73 74 61 74 69 63 20 | 42 6f 6f 6c 65 61 6e 0d |.static |Boolean.|
|000026d0| 50 74 49 6e 54 65 78 74 | 20 28 57 69 6e 64 6f 77 |PtInText| (Window|
|000026e0| 50 74 72 20 77 2c 20 50 | 6f 69 6e 74 20 70 74 29 |Ptr w, P|oint pt)|
|000026f0| 0d 7b 0d 52 65 63 74 09 | 72 3b 0d 0d 09 72 20 3d |.{.Rect.|r;...r =|
|00002700| 20 77 2d 3e 70 6f 72 74 | 52 65 63 74 3b 0d 09 72 | w->port|Rect;..r|
|00002710| 2e 72 69 67 68 74 20 2d | 3d 20 31 35 3b 0d 09 72 |.right -|= 15;..r|
|00002720| 65 74 75 72 6e 20 28 50 | 74 49 6e 52 65 63 74 20 |eturn (P|tInRect |
|00002730| 28 70 74 2c 20 26 72 29 | 29 3b 0d 7d 0d 0d 0d 2f |(pt, &r)|);.}.../|
|00002740| 2a 0d 20 2a 20 53 65 74 | 20 74 68 65 20 63 75 72 |*. * Set| the cur|
|00002750| 73 6f 72 20 61 70 70 72 | 6f 70 72 69 61 74 65 6c |sor appr|opriatel|
|00002760| 79 2e 20 20 49 66 20 74 | 68 65 43 75 72 73 6f 72 |y. If t|heCursor|
|00002770| 20 3d 3d 20 69 42 65 61 | 6d 43 75 72 73 6f 72 2c | == iBea|mCursor,|
|00002780| 20 63 68 65 63 6b 0d 20 | 2a 20 74 68 61 74 20 69 | check. |* that i|
|00002790| 74 27 73 20 72 65 61 6c | 6c 79 20 69 6e 20 74 68 |t's real|ly in th|
|000027a0| 65 20 74 65 78 74 20 61 | 72 65 61 20 6f 66 20 61 |e text a|rea of a|
|000027b0| 6e 20 65 64 69 74 20 77 | 69 6e 64 6f 77 20 28 61 |n edit w|indow (a|
|000027c0| 6e 64 20 69 66 20 6e 6f | 74 0d 20 2a 20 73 65 74 |nd if no|t. * set|
|000027d0| 20 74 68 65 20 63 75 72 | 73 6f 72 20 74 6f 20 61 | the cur|sor to a|
|000027e0| 6e 20 61 72 72 6f 77 20 | 69 6e 73 74 65 61 64 29 |n arrow |instead)|
|000027f0| 2e 20 20 4f 74 68 65 72 | 77 69 73 65 2c 20 73 65 |. Other|wise, se|
|00002800| 74 20 74 68 65 20 63 75 | 72 73 6f 72 0d 20 2a 20 |t the cu|rsor. * |
|00002810| 74 6f 20 74 68 65 20 67 | 69 76 65 6e 20 74 79 70 |to the g|iven typ|
|00002820| 65 20 28 75 73 75 61 6c | 6c 79 20 61 20 77 61 74 |e (usual|ly a wat|
|00002830| 63 68 29 2e 0d 20 2a 0d | 20 2a 20 50 61 73 73 20 |ch).. *.| * Pass |
|00002840| 2d 31 20 66 6f 72 20 74 | 68 65 43 75 72 73 6f 72 |-1 for t|heCursor|
|00002850| 20 74 6f 20 73 65 74 20 | 74 68 65 20 63 75 72 73 | to set |the curs|
|00002860| 6f 72 20 74 6f 20 74 68 | 65 20 61 72 72 6f 77 2e |or to th|e arrow.|
|00002870| 0d 20 2a 2f 0d 0d 73 74 | 61 74 69 63 20 76 6f 69 |. */..st|atic voi|
|00002880| 64 0d 46 69 78 43 75 72 | 73 6f 72 20 28 73 68 6f |d.FixCur|sor (sho|
|00002890| 72 74 20 74 68 65 43 75 | 72 73 6f 72 29 0d 7b 0d |rt theCu|rsor).{.|
|000028a0| 57 69 6e 64 6f 77 50 74 | 72 09 77 3b 0d 47 72 61 |WindowPt|r.w;.Gra|
|000028b0| 66 50 74 72 09 09 73 61 | 76 65 50 6f 72 74 3b 0d |fPtr..sa|vePort;.|
|000028c0| 50 6f 69 6e 74 09 09 70 | 74 3b 0d 0d 09 69 66 20 |Point..p|t;...if |
|000028d0| 28 74 68 65 43 75 72 73 | 6f 72 20 3d 3d 20 69 42 |(theCurs|or == iB|
|000028e0| 65 61 6d 43 75 72 73 6f | 72 29 09 09 09 2f 2a 20 |eamCurso|r).../* |
|000028f0| 63 68 65 63 6b 20 77 68 | 65 74 68 65 72 20 74 68 |check wh|ether th|
|00002900| 65 72 65 27 73 20 61 6e | 20 65 64 69 74 20 2a 2f |ere's an| edit */|
|00002910| 0d 09 7b 09 09 09 09 09 | 09 09 09 09 09 2f 2a 20 |..{.....|...../* |
|00002920| 77 69 6e 64 6f 77 20 69 | 6e 20 66 72 6f 6e 74 20 |window i|n front |
|00002930| 61 6e 64 20 69 66 20 73 | 6f 2c 20 20 20 20 2a 2f |and if s|o, */|
|00002940| 0d 09 09 74 68 65 43 75 | 72 73 6f 72 20 3d 20 2d |...theCu|rsor = -|
|00002950| 31 3b 09 09 09 09 09 09 | 2f 2a 20 77 68 65 74 68 |1;......|/* wheth|
|00002960| 65 72 20 74 68 65 20 63 | 75 72 73 6f 72 27 73 20 |er the c|ursor's |
|00002970| 69 6e 20 69 74 73 20 20 | 20 2a 2f 0d 09 09 77 20 |in its | */...w |
|00002980| 3d 20 46 72 6f 6e 74 57 | 69 6e 64 6f 77 20 28 29 |= FrontW|indow ()|
|00002990| 3b 09 09 09 09 09 2f 2a | 20 74 65 78 74 20 61 72 |;...../*| text ar|
|000029a0| 65 61 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ea | |
|000029b0| 20 20 20 20 20 20 20 2a | 2f 0d 09 09 69 66 20 28 | *|/...if (|
|000029c0| 49 73 45 57 69 6e 64 6f | 77 20 28 77 29 29 0d 09 |IsEWindo|w (w))..|
|000029d0| 09 7b 0d 09 09 09 47 65 | 74 50 6f 72 74 20 28 26 |.{....Ge|tPort (&|
|000029e0| 73 61 76 65 50 6f 72 74 | 29 3b 0d 09 09 09 53 65 |savePort|);....Se|
|000029f0| 74 50 6f 72 74 20 28 77 | 29 3b 0d 09 09 09 47 65 |tPort (w|);....Ge|
|00002a00| 74 4d 6f 75 73 65 20 28 | 26 70 74 29 3b 0d 09 09 |tMouse (|&pt);...|
|00002a10| 09 69 66 20 28 50 74 49 | 6e 54 65 78 74 20 28 77 |.if (PtI|nText (w|
|00002a20| 2c 20 70 74 29 29 0d 09 | 09 09 09 74 68 65 43 75 |, pt))..|...theCu|
|00002a30| 72 73 6f 72 20 3d 20 69 | 42 65 61 6d 43 75 72 73 |rsor = i|BeamCurs|
|00002a40| 6f 72 3b 0d 09 09 09 53 | 65 74 50 6f 72 74 20 28 |or;....S|etPort (|
|00002a50| 73 61 76 65 50 6f 72 74 | 29 3b 0d 09 09 7d 0d 09 |savePort|);...}..|
|00002a60| 7d 0d 09 53 65 74 43 75 | 72 73 6f 72 20 28 74 68 |}..SetCu|rsor (th|
|00002a70| 65 43 75 72 73 6f 72 20 | 3d 3d 20 2d 31 20 3f 20 |eCursor |== -1 ? |
|00002a80| 26 61 72 72 6f 77 20 3a | 20 2a 47 65 74 43 75 72 |&arrow :| *GetCur|
|00002a90| 73 6f 72 20 28 74 68 65 | 43 75 72 73 6f 72 29 29 |sor (the|Cursor))|
|00002aa0| 3b 0d 7d 0d 0d 0d 2f 2a | 0d 20 2a 20 43 61 6c 63 |;.}.../*|. * Calc|
|00002ab0| 75 6c 61 74 65 20 74 68 | 65 20 6e 75 6d 62 65 72 |ulate th|e number|
|00002ac0| 20 6f 66 20 6c 69 6e 65 | 73 20 63 75 72 72 65 6e | of line|s curren|
|00002ad0| 74 6c 79 20 73 63 72 6f | 6c 6c 65 64 20 6f 66 66 |tly scro|lled off|
|00002ae0| 0d 20 2a 20 74 68 65 20 | 74 6f 70 20 6f 66 20 61 |. * the |top of a|
|00002af0| 6e 20 65 64 69 74 20 72 | 65 63 6f 72 64 2e 0d 20 |n edit r|ecord.. |
|00002b00| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 73 68 6f 72 74 |*/..stat|ic short|
|00002b10| 0d 4c 69 6e 65 73 4f 66 | 66 54 6f 70 20 28 54 45 |.LinesOf|fTop (TE|
|00002b20| 48 61 6e 64 6c 65 20 68 | 54 45 29 0d 7b 0d 09 72 |Handle h|TE).{..r|
|00002b30| 65 74 75 72 6e 20 28 28 | 28 2a 2a 68 54 45 29 2e |eturn ((|(**hTE).|
|00002b40| 76 69 65 77 52 65 63 74 | 2e 74 6f 70 20 2d 20 28 |viewRect|.top - (|
|00002b50| 2a 2a 68 54 45 29 2e 64 | 65 73 74 52 65 63 74 2e |**hTE).d|estRect.|
|00002b60| 74 6f 70 29 20 2f 20 28 | 2a 2a 68 54 45 29 2e 6c |top) / (|**hTE).l|
|00002b70| 69 6e 65 48 65 69 67 68 | 74 29 3b 0d 7d 0d 0d 0d |ineHeigh|t);.}...|
|00002b80| 2f 2a 0d 20 2a 20 52 65 | 74 75 72 6e 20 74 68 65 |/*. * Re|turn the|
|00002b90| 20 6c 69 6e 65 20 6e 75 | 6d 62 65 72 20 74 68 61 | line nu|mber tha|
|00002ba0| 74 20 74 68 65 20 63 61 | 72 65 74 20 28 6f 72 20 |t the ca|ret (or |
|00002bb0| 74 68 65 20 62 65 67 69 | 6e 6e 69 6e 67 20 6f 66 |the begi|nning of|
|00002bc0| 0d 20 2a 20 74 68 65 20 | 63 75 72 72 65 6e 74 6c |. * the |currentl|
|00002bd0| 79 20 73 65 6c 65 63 74 | 65 64 20 74 65 78 74 29 |y select|ed text)|
|00002be0| 20 69 73 20 69 6e 2e 20 | 20 56 61 6c 75 65 20 72 | is in. | Value r|
|00002bf0| 65 74 75 72 6e 65 64 20 | 69 73 20 69 6e 0d 20 2a |eturned |is in. *|
|00002c00| 20 74 68 65 20 72 61 6e | 67 65 20 30 2e 2e 28 2a | the ran|ge 0..(*|
|00002c10| 2a 65 64 69 74 54 45 29 | 2e 6e 4c 69 6e 65 73 2e |*editTE)|.nLines.|
|00002c20| 20 20 49 66 20 3d 20 28 | 2a 2a 65 64 69 74 54 45 | If = (|**editTE|
|00002c30| 29 2e 6e 4c 69 6e 65 73 | 2c 20 74 68 65 0d 20 2a |).nLines|, the. *|
|00002c40| 20 63 61 72 65 74 20 69 | 73 20 70 61 73 74 20 74 | caret i|s past t|
|00002c50| 68 65 20 6c 61 73 74 20 | 6c 69 6e 65 2e 20 20 54 |he last |line. T|
|00002c60| 68 65 20 6f 6e 6c 79 20 | 73 70 65 63 69 61 6c 20 |he only |special |
|00002c70| 63 61 73 65 20 74 6f 20 | 77 61 74 63 68 20 6f 75 |case to |watch ou|
|00002c80| 74 0d 20 2a 20 66 6f 72 | 20 69 73 20 77 68 65 6e |t. * for| is when|
|00002c90| 20 74 68 65 20 63 61 72 | 65 74 20 69 73 20 61 74 | the car|et is at|
|00002ca0| 20 74 68 65 20 76 65 72 | 79 20 65 6e 64 20 6f 66 | the ver|y end of|
|00002cb0| 20 74 68 65 20 74 65 78 | 74 2e 20 20 49 66 20 74 | the tex|t. If t|
|00002cc0| 68 65 0d 20 2a 20 6c 61 | 73 74 20 63 68 61 72 61 |he. * la|st chara|
|00002cd0| 63 74 65 72 20 69 73 20 | 6e 6f 74 20 61 20 63 61 |cter is |not a ca|
|00002ce0| 72 72 69 61 67 65 20 72 | 65 74 75 72 6e 2c 20 74 |rriage r|eturn, t|
|00002cf0| 68 65 6e 20 74 68 65 20 | 63 61 72 65 74 20 69 73 |hen the |caret is|
|00002d00| 20 6f 6e 0d 20 2a 20 74 | 68 65 20 28 6e 4c 69 6e | on. * t|he (nLin|
|00002d10| 65 73 2d 31 29 74 68 20 | 6c 69 6e 65 2c 20 6e 6f |es-1)th |line, no|
|00002d20| 74 20 74 68 65 20 28 6e | 4c 69 6e 65 73 29 74 68 |t the (n|Lines)th|
|00002d30| 20 6c 69 6e 65 2e 0d 20 | 2a 0d 20 2a 20 28 54 68 | line.. |*. * (Th|
|00002d40| 69 73 20 72 65 61 6c 6c | 79 20 73 68 6f 75 6c 64 |is reall|y should|
|00002d50| 20 64 6f 20 61 20 62 69 | 6e 61 72 79 20 73 65 61 | do a bi|nary sea|
|00002d60| 72 63 68 20 66 6f 72 20 | 73 70 65 65 64 2e 29 0d |rch for |speed.).|
|00002d70| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 73 68 6f 72 | */..sta|tic shor|
|00002d80| 74 0d 4c 69 6e 65 57 69 | 74 68 43 61 72 65 74 20 |t.LineWi|thCaret |
|00002d90| 28 54 45 48 61 6e 64 6c | 65 20 68 54 45 29 0d 7b |(TEHandl|e hTE).{|
|00002da0| 0d 73 68 6f 72 74 09 69 | 3b 0d 73 68 6f 72 74 09 |.short.i|;.short.|
|00002db0| 6e 4c 69 6e 65 73 3b 0d | 73 68 6f 72 74 09 74 65 |nLines;.|short.te|
|00002dc0| 4c 65 6e 67 74 68 3b 0d | 73 68 6f 72 74 09 73 65 |Length;.|short.se|
|00002dd0| 6c 53 74 61 72 74 3b 0d | 73 68 6f 72 74 09 6c 69 |lStart;.|short.li|
|00002de0| 6e 65 53 74 61 72 74 3b | 0d 0d 09 73 65 6c 53 74 |neStart;|...selSt|
|00002df0| 61 72 74 20 3d 20 28 2a | 2a 68 54 45 29 2e 73 65 |art = (*|*hTE).se|
|00002e00| 6c 53 74 61 72 74 3b 0d | 09 6e 4c 69 6e 65 73 20 |lStart;.|.nLines |
|00002e10| 3d 20 28 2a 2a 68 54 45 | 29 2e 6e 4c 69 6e 65 73 |= (**hTE|).nLines|
|00002e20| 3b 0d 09 74 65 4c 65 6e | 67 74 68 20 3d 20 28 2a |;..teLen|gth = (*|
|00002e30| 2a 68 54 45 29 2e 74 65 | 4c 65 6e 67 74 68 3b 0d |*hTE).te|Length;.|
|00002e40| 0d 09 69 66 20 28 73 65 | 6c 53 74 61 72 74 20 3d |..if (se|lStart =|
|00002e50| 3d 20 74 65 4c 65 6e 67 | 74 68 29 0d 09 7b 0d 09 |= teLeng|th)..{..|
|00002e60| 09 69 66 20 28 74 65 4c | 65 6e 67 74 68 20 21 3d |.if (teL|ength !=|
|00002e70| 20 30 20 26 26 20 28 2a | 28 28 2a 2a 68 54 45 29 | 0 && (*|((**hTE)|
|00002e80| 2e 68 54 65 78 74 29 29 | 5b 74 65 4c 65 6e 67 74 |.hText))|[teLengt|
|00002e90| 68 2d 31 5d 20 21 3d 20 | 63 72 29 0d 09 09 09 72 |h-1] != |cr)....r|
|00002ea0| 65 74 75 72 6e 20 28 6e | 4c 69 6e 65 73 20 2d 20 |eturn (n|Lines - |
|00002eb0| 31 29 3b 0d 09 09 72 65 | 74 75 72 6e 20 28 6e 4c |1);...re|turn (nL|
|00002ec0| 69 6e 65 73 29 3b 0d 09 | 7d 0d 0d 09 66 6f 72 20 |ines);..|}...for |
|00002ed0| 28 69 20 3d 20 30 3b 20 | 2f 2a 20 65 6d 70 74 79 |(i = 0; |/* empty|
|00002ee0| 20 2a 2f 3b 20 2b 2b 69 | 29 0d 09 7b 0d 09 09 69 | */; ++i|)..{...i|
|00002ef0| 66 20 28 28 6c 69 6e 65 | 53 74 61 72 74 20 3d 20 |f ((line|Start = |
|00002f00| 28 2a 2a 68 54 45 29 2e | 6c 69 6e 65 53 74 61 72 |(**hTE).|lineStar|
|00002f10| 74 73 5b 69 5d 29 20 3e | 3d 20 73 65 6c 53 74 61 |ts[i]) >|= selSta|
|00002f20| 72 74 29 0d 09 09 7b 0d | 09 09 09 69 66 20 28 6c |rt)...{.|...if (l|
|00002f30| 69 6e 65 53 74 61 72 74 | 20 21 3d 20 73 65 6c 53 |ineStart| != selS|
|00002f40| 74 61 72 74 29 0d 09 09 | 09 09 2d 2d 69 3b 0d 09 |tart)...|..--i;..|
|00002f50| 09 09 72 65 74 75 72 6e | 20 28 69 29 3b 0d 09 09 |..return| (i);...|
|00002f60| 7d 0d 09 7d 0d 7d 0d 0d | 0d 2f 2a 0d 20 2a 20 52 |}..}.}..|./*. * R|
|00002f70| 65 74 75 72 6e 20 74 68 | 65 20 6e 75 6d 62 65 72 |eturn th|e number|
|00002f80| 20 6f 66 20 74 68 65 20 | 6c 61 73 74 20 64 69 73 | of the |last dis|
|00002f90| 70 6c 61 79 61 62 6c 65 | 20 6c 69 6e 65 2e 20 20 |playable| line. |
|00002fa0| 54 68 61 74 27 73 20 6f | 6e 65 0d 20 2a 20 6d 6f |That's o|ne. * mo|
|00002fb0| 72 65 20 74 68 61 6e 20 | 6e 4c 69 6e 65 73 20 69 |re than |nLines i|
|00002fc0| 66 20 74 68 65 20 74 65 | 78 74 20 69 73 20 65 6d |f the te|xt is em|
|00002fd0| 70 74 79 20 6f 72 20 74 | 68 65 20 6c 61 73 74 20 |pty or t|he last |
|00002fe0| 63 68 61 72 61 63 74 65 | 72 0d 20 2a 20 69 73 20 |characte|r. * is |
|00002ff0| 61 20 63 61 72 72 69 61 | 67 65 20 72 65 74 75 72 |a carria|ge retur|
|00003000| 6e 2e 0d 20 2a 2f 0d 0d | 73 74 61 74 69 63 20 73 |n.. */..|static s|
|00003010| 68 6f 72 74 0d 4c 61 73 | 74 4c 69 6e 65 20 28 54 |hort.Las|tLine (T|
|00003020| 45 48 61 6e 64 6c 65 20 | 68 54 45 29 0d 7b 0d 73 |EHandle |hTE).{.s|
|00003030| 68 6f 72 74 09 6e 4c 69 | 6e 65 73 3b 0d 73 68 6f |hort.nLi|nes;.sho|
|00003040| 72 74 09 74 65 4c 65 6e | 67 74 68 3b 0d 0d 09 6e |rt.teLen|gth;...n|
|00003050| 4c 69 6e 65 73 20 3d 20 | 28 2a 2a 68 54 45 29 2e |Lines = |(**hTE).|
|00003060| 6e 4c 69 6e 65 73 3b 0d | 09 74 65 4c 65 6e 67 74 |nLines;.|.teLengt|
|00003070| 68 20 3d 20 28 2a 2a 68 | 54 45 29 2e 74 65 4c 65 |h = (**h|TE).teLe|
|00003080| 6e 67 74 68 3b 0d 0d 09 | 69 66 20 28 74 65 4c 65 |ngth;...|if (teLe|
|00003090| 6e 67 74 68 20 3d 3d 20 | 30 20 7c 7c 20 28 2a 28 |ngth == |0 || (*(|
|000030a0| 28 2a 2a 68 54 45 29 2e | 68 54 65 78 74 29 29 5b |(**hTE).|hText))[|
|000030b0| 74 65 4c 65 6e 67 74 68 | 2d 31 5d 20 3d 3d 20 63 |teLength|-1] == c|
|000030c0| 72 29 0d 09 09 6e 4c 69 | 6e 65 73 2b 2b 3b 0d 09 |r)...nLi|nes++;..|
|000030d0| 72 65 74 75 72 6e 20 28 | 6e 4c 69 6e 65 73 29 3b |return (|nLines);|
|000030e0| 0d 7d 0d 0d 0d 2f 2a 0d | 20 2a 20 48 69 67 68 6c |.}.../*.| * Highl|
|000030f0| 69 67 68 74 20 74 68 65 | 20 73 63 72 6f 6c 6c 20 |ight the| scroll |
|00003100| 62 61 72 20 70 72 6f 70 | 65 72 6c 79 2e 20 20 54 |bar prop|erly. T|
|00003110| 68 69 73 20 6d 65 61 6e | 73 20 74 68 61 74 20 69 |his mean|s that i|
|00003120| 74 27 73 20 6e 6f 74 0d | 20 2a 20 6d 61 64 65 20 |t's not.| * made |
|00003130| 61 63 74 69 76 65 20 69 | 66 20 74 68 65 20 77 69 |active i|f the wi|
|00003140| 6e 64 6f 77 20 69 74 73 | 65 6c 66 20 69 73 6e 27 |ndow its|elf isn'|
|00003150| 74 20 61 63 74 69 76 65 | 2c 20 65 76 65 6e 20 69 |t active|, even i|
|00003160| 66 0d 20 2a 20 74 68 65 | 72 65 27 73 20 65 6e 6f |f. * the|re's eno|
|00003170| 75 67 68 20 74 65 78 74 | 20 74 6f 20 66 69 6c 6c |ugh text| to fill|
|00003180| 20 74 68 65 20 77 69 6e | 64 6f 77 2e 0d 20 2a 2f | the win|dow.. */|
|00003190| 0d 0d 73 74 61 74 69 63 | 20 76 6f 69 64 0d 48 69 |..static| void.Hi|
|000031a0| 6c 69 74 65 53 63 72 6f | 6c 6c 20 28 44 6f 63 48 |liteScro|ll (DocH|
|000031b0| 61 6e 64 6c 65 20 64 6f | 63 29 0d 7b 0d 57 69 6e |andle do|c).{.Win|
|000031c0| 64 6f 77 50 74 72 09 77 | 3b 0d 43 6f 6e 74 72 6f |dowPtr.w|;.Contro|
|000031d0| 6c 48 61 6e 64 6c 65 09 | 73 63 72 6f 6c 6c 3b 0d |lHandle.|scroll;.|
|000031e0| 73 68 6f 72 74 09 68 69 | 6c 69 74 65 3b 0d 0d 09 |short.hi|lite;...|
|000031f0| 77 20 3d 20 44 6f 63 57 | 69 6e 64 20 28 64 6f 63 |w = DocW|ind (doc|
|00003200| 29 3b 0d 09 73 63 72 6f | 6c 6c 20 3d 20 44 6f 63 |);..scro|ll = Doc|
|00003210| 53 63 72 6f 6c 6c 20 28 | 64 6f 63 29 3b 0d 09 68 |Scroll (|doc);..h|
|00003220| 69 6c 69 74 65 20 3d 20 | 28 57 69 6e 64 6f 77 49 |ilite = |(WindowI|
|00003230| 73 41 63 74 69 76 65 20 | 28 77 29 20 26 26 20 47 |sActive |(w) && G|
|00003240| 65 74 43 74 6c 4d 61 78 | 20 28 73 63 72 6f 6c 6c |etCtlMax| (scroll|
|00003250| 29 20 3e 20 30 0d 09 09 | 09 09 3f 20 6e 6f 72 6d |) > 0...|..? norm|
|00003260| 61 6c 48 69 6c 69 74 65 | 20 3a 20 64 69 6d 48 69 |alHilite| : dimHi|
|00003270| 6c 69 74 65 29 3b 0d 09 | 48 69 6c 69 74 65 43 6f |lite);..|HiliteCo|
|00003280| 6e 74 72 6f 6c 20 28 73 | 63 72 6f 6c 6c 2c 20 68 |ntrol (s|croll, h|
|00003290| 69 6c 69 74 65 29 3b 0d | 7d 0d 0d 0d 2f 2a 0d 20 |ilite);.|}.../*. |
|000032a0| 2a 20 53 65 74 20 73 63 | 72 6f 6c 6c 20 62 61 72 |* Set sc|roll bar|
|000032b0| 20 63 75 72 72 65 6e 74 | 20 76 61 6c 75 65 20 28 | current| value (|
|000032c0| 62 75 74 20 6f 6e 6c 79 | 20 69 66 20 69 74 27 73 |but only| if it's|
|000032d0| 20 64 69 66 66 65 72 65 | 6e 74 20 74 68 61 6e 0d | differe|nt than.|
|000032e0| 20 2a 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 76 | * the c|urrent v|
|000032f0| 61 6c 75 65 2c 20 74 6f | 20 61 76 6f 69 64 20 6e |alue, to| avoid n|
|00003300| 65 65 64 6c 65 73 73 20 | 66 6c 61 73 68 69 6e 67 |eedless |flashing|
|00003310| 29 2e 0d 20 2a 2f 0d 0d | 73 74 61 74 69 63 20 76 |).. */..|static v|
|00003320| 6f 69 64 0d 53 65 74 53 | 63 72 6f 6c 6c 56 61 6c |oid.SetS|crollVal|
|00003330| 75 65 20 28 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |ue (Cont|rolHandl|
|00003340| 65 20 73 63 72 6f 6c 6c | 2c 20 73 68 6f 72 74 20 |e scroll|, short |
|00003350| 76 61 6c 75 65 29 0d 7b | 0d 09 69 66 20 28 47 65 |value).{|..if (Ge|
|00003360| 74 43 74 6c 56 61 6c 75 | 65 20 28 73 63 72 6f 6c |tCtlValu|e (scrol|
|00003370| 6c 29 20 21 3d 20 76 61 | 6c 75 65 29 0d 09 09 53 |l) != va|lue)...S|
|00003380| 65 74 43 74 6c 56 61 6c | 75 65 20 28 73 63 72 6f |etCtlVal|ue (scro|
|00003390| 6c 6c 2c 20 76 61 6c 75 | 65 29 3b 0d 7d 0d 0d 0d |ll, valu|e);.}...|
|000033a0| 2f 2a 0d 20 2a 20 53 65 | 74 20 74 68 65 20 6d 61 |/*. * Se|t the ma|
|000033b0| 78 69 6d 75 6d 20 76 61 | 6c 75 65 20 6f 66 20 74 |ximum va|lue of t|
|000033c0| 68 65 20 73 63 72 6f 6c | 6c 20 62 61 72 2e 20 20 |he scrol|l bar. |
|000033d0| 49 74 27 73 20 73 65 74 | 20 73 6f 20 74 68 61 74 |It's set| so that|
|000033e0| 20 69 66 0d 20 2a 20 74 | 68 65 72 65 27 73 20 6d | if. * t|here's m|
|000033f0| 6f 72 65 20 74 65 78 74 | 20 74 68 61 6e 20 66 69 |ore text| than fi|
|00003400| 74 73 20 69 6e 20 74 68 | 65 20 77 69 6e 64 6f 77 |ts in th|e window|
|00003410| 2c 20 74 68 65 20 62 6f | 74 74 6f 6d 20 6c 69 6e |, the bo|ttom lin|
|00003420| 65 20 63 61 6e 0d 20 2a | 20 62 65 20 73 63 72 6f |e can. *| be scro|
|00003430| 6c 6c 65 64 20 75 70 20 | 61 74 20 6c 65 61 73 74 |lled up |at least|
|00003440| 20 61 20 6c 69 74 74 6c | 65 20 62 65 6c 6f 77 20 | a littl|e below |
|00003450| 74 68 65 20 62 6f 74 74 | 6f 6d 20 6f 66 20 74 68 |the bott|om of th|
|00003460| 65 20 77 69 6e 64 6f 77 | 2e 0d 20 2a 0d 20 2a 20 |e window|.. *. * |
|00003470| 54 68 65 20 73 68 65 6e | 61 6e 69 67 61 6e 73 20 |The shen|anigans |
|00003480| 77 69 74 68 20 74 6f 70 | 4c 69 6e 65 73 20 61 6e |with top|Lines an|
|00003490| 64 20 73 63 72 6f 6c 6c | 61 62 6c 65 4c 69 6e 65 |d scroll|ableLine|
|000034a0| 73 20 68 61 76 65 20 74 | 6f 20 64 6f 20 77 69 74 |s have t|o do wit|
|000034b0| 68 0d 20 2a 20 74 68 65 | 20 63 61 73 65 20 77 68 |h. * the| case wh|
|000034c0| 65 72 65 20 74 68 65 72 | 65 20 6d 61 79 20 62 65 |ere ther|e may be|
|000034d0| 20 6c 65 73 73 20 74 65 | 78 74 20 74 68 61 6e 20 | less te|xt than |
|000034e0| 66 69 6c 6c 73 20 74 68 | 65 20 77 69 6e 64 6f 77 |fills th|e window|
|000034f0| 2c 20 62 75 74 0d 20 2a | 20 6d 6f 73 74 20 6f 66 |, but. *| most of|
|00003500| 20 69 74 27 73 20 73 63 | 72 6f 6c 6c 65 64 20 6f | it's sc|rolled o|
|00003510| 66 66 20 74 68 65 20 74 | 6f 70 2e 20 20 54 68 69 |ff the t|op. Thi|
|00003520| 73 20 63 61 6e 20 68 61 | 70 70 65 6e 20 77 68 65 |s can ha|ppen whe|
|00003530| 6e 20 79 6f 75 0d 20 2a | 20 73 63 72 6f 6c 6c 20 |n you. *| scroll |
|00003540| 61 20 62 75 6e 63 68 20 | 6f 66 20 73 74 75 66 66 |a bunch |of stuff|
|00003550| 20 75 70 2c 20 74 68 65 | 6e 20 64 65 6c 65 74 65 | up, the|n delete|
|00003560| 20 65 76 65 72 79 74 68 | 69 6e 67 20 76 69 73 69 | everyth|ing visi|
|00003570| 62 6c 65 20 69 6e 0d 20 | 2a 20 74 68 65 20 77 69 |ble in. |* the wi|
|00003580| 6e 64 6f 77 2e 0d 20 2a | 2f 0d 0d 73 74 61 74 69 |ndow.. *|/..stati|
|00003590| 63 20 76 6f 69 64 0d 53 | 65 74 53 63 72 6f 6c 6c |c void.S|etScroll|
|000035a0| 4d 61 78 20 28 44 6f 63 | 48 61 6e 64 6c 65 20 64 |Max (Doc|Handle d|
|000035b0| 6f 63 29 0d 7b 0d 43 6f | 6e 74 72 6f 6c 48 61 6e |oc).{.Co|ntrolHan|
|000035c0| 64 6c 65 09 73 63 72 6f | 6c 6c 3b 0d 54 45 48 61 |dle.scro|ll;.TEHa|
|000035d0| 6e 64 6c 65 09 09 68 54 | 45 3b 0d 73 68 6f 72 74 |ndle..hT|E;.short|
|000035e0| 09 74 6f 70 4c 69 6e 65 | 73 3b 0d 73 68 6f 72 74 |.topLine|s;.short|
|000035f0| 09 73 63 72 6f 6c 6c 61 | 62 6c 65 4c 69 6e 65 73 |.scrolla|bleLines|
|00003600| 3b 0d 73 68 6f 72 74 09 | 6d 61 78 3b 0d 0d 09 73 |;.short.|max;...s|
|00003610| 63 72 6f 6c 6c 20 3d 20 | 44 6f 63 53 63 72 6f 6c |croll = |DocScrol|
|00003620| 6c 20 28 64 6f 63 29 3b | 0d 09 68 54 45 20 3d 20 |l (doc);|..hTE = |
|00003630| 44 6f 63 54 45 20 28 64 | 6f 63 29 3b 0d 0d 09 74 |DocTE (d|oc);...t|
|00003640| 6f 70 4c 69 6e 65 73 20 | 3d 20 4c 69 6e 65 73 4f |opLines |= LinesO|
|00003650| 66 66 54 6f 70 20 28 68 | 54 45 29 3b 0d 09 73 63 |ffTop (h|TE);..sc|
|00003660| 72 6f 6c 6c 61 62 6c 65 | 4c 69 6e 65 73 20 3d 20 |rollable|Lines = |
|00003670| 4c 61 73 74 4c 69 6e 65 | 20 28 68 54 45 29 20 2d |LastLine| (hTE) -|
|00003680| 20 44 6f 63 56 69 73 4c | 69 6e 65 73 20 28 64 6f | DocVisL|ines (do|
|00003690| 63 29 3b 3b 0d 09 6d 61 | 78 20 3d 20 28 74 6f 70 |c);;..ma|x = (top|
|000036a0| 4c 69 6e 65 73 20 3e 20 | 73 63 72 6f 6c 6c 61 62 |Lines > |scrollab|
|000036b0| 6c 65 4c 69 6e 65 73 20 | 3f 20 74 6f 70 4c 69 6e |leLines |? topLin|
|000036c0| 65 73 20 3a 20 73 63 72 | 6f 6c 6c 61 62 6c 65 4c |es : scr|ollableL|
|000036d0| 69 6e 65 73 29 3b 0d 0d | 09 69 66 20 28 6d 61 78 |ines);..|.if (max|
|000036e0| 20 3c 20 30 29 0d 09 09 | 6d 61 78 20 3d 20 30 3b | < 0)...|max = 0;|
|000036f0| 0d 0d 09 69 66 20 28 6d | 61 78 20 21 3d 20 47 65 |...if (m|ax != Ge|
|00003700| 74 43 74 6c 4d 61 78 20 | 28 73 63 72 6f 6c 6c 29 |tCtlMax |(scroll)|
|00003710| 29 0d 09 7b 0d 09 09 53 | 65 74 43 74 6c 4d 61 78 |)..{...S|etCtlMax|
|00003720| 20 28 73 63 72 6f 6c 6c | 2c 20 6d 61 78 29 3b 0d | (scroll|, max);.|
|00003730| 09 09 48 69 6c 69 74 65 | 53 63 72 6f 6c 6c 20 28 |..Hilite|Scroll (|
|00003740| 64 6f 63 29 3b 0d 09 7d | 0d 7d 0d 0d 0d 2f 2a 0d |doc);..}|.}.../*.|
|00003750| 20 2a 20 53 63 72 6f 6c | 6c 20 74 6f 20 74 68 65 | * Scrol|l to the|
|00003760| 20 63 6f 72 72 65 63 74 | 20 70 6f 73 69 74 69 6f | correct| positio|
|00003770| 6e 2e 20 20 6c 44 65 6c | 74 61 20 69 73 20 74 68 |n. lDel|ta is th|
|00003780| 65 0d 20 2a 20 61 6d 6f | 75 6e 74 20 74 6f 20 43 |e. * amo|unt to C|
|00003790| 48 41 4e 47 45 20 74 68 | 65 20 63 75 72 72 65 6e |HANGE th|e curren|
|000037a0| 74 20 73 63 72 6f 6c 6c | 20 73 65 74 74 69 6e 67 |t scroll| setting|
|000037b0| 20 62 79 2e 0d 20 2a 20 | 50 6f 73 69 74 69 76 65 | by.. * |Positive|
|000037c0| 20 73 63 72 6f 6c 6c 73 | 20 74 68 65 20 74 65 78 | scrolls| the tex|
|000037d0| 74 20 75 70 2c 20 6e 65 | 67 61 74 69 76 65 20 64 |t up, ne|gative d|
|000037e0| 6f 77 6e 2e 0d 20 2a 2f | 0d 0d 73 74 61 74 69 63 |own.. */|..static|
|000037f0| 20 76 6f 69 64 0d 53 63 | 72 6f 6c 6c 54 65 78 74 | void.Sc|rollText|
|00003800| 20 28 44 6f 63 48 61 6e | 64 6c 65 20 64 6f 63 2c | (DocHan|dle doc,|
|00003810| 20 73 68 6f 72 74 20 6c | 44 65 6c 74 61 29 0d 7b | short l|Delta).{|
|00003820| 0d 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 09 73 |.Control|Handle.s|
|00003830| 63 72 6f 6c 6c 3b 0d 54 | 45 48 61 6e 64 6c 65 09 |croll;.T|EHandle.|
|00003840| 68 54 45 3b 0d 73 68 6f | 72 74 09 74 6f 70 56 69 |hTE;.sho|rt.topVi|
|00003850| 73 4c 69 6e 65 3b 0d 73 | 68 6f 72 74 09 6e 65 77 |sLine;.s|hort.new|
|00003860| 54 6f 70 56 69 73 4c 69 | 6e 65 3b 0d 0d 09 73 63 |TopVisLi|ne;...sc|
|00003870| 72 6f 6c 6c 20 3d 20 44 | 6f 63 53 63 72 6f 6c 6c |roll = D|ocScroll|
|00003880| 20 28 64 6f 63 29 3b 0d | 09 68 54 45 20 3d 20 44 | (doc);.|.hTE = D|
|00003890| 6f 63 54 45 20 28 64 6f | 63 29 3b 0d 0d 09 74 6f |ocTE (do|c);...to|
|000038a0| 70 56 69 73 4c 69 6e 65 | 20 3d 20 4c 69 6e 65 73 |pVisLine| = Lines|
|000038b0| 4f 66 66 54 6f 70 20 28 | 68 54 45 29 3b 0d 20 20 |OffTop (|hTE);. |
|000038c0| 20 20 6e 65 77 54 6f 70 | 56 69 73 4c 69 6e 65 20 | newTop|VisLine |
|000038d0| 3d 20 74 6f 70 56 69 73 | 4c 69 6e 65 20 2b 20 6c |= topVis|Line + l|
|000038e0| 44 65 6c 74 61 3b 0d 20 | 20 20 20 69 66 20 28 6e |Delta;. | if (n|
|000038f0| 65 77 54 6f 70 56 69 73 | 4c 69 6e 65 20 3c 20 30 |ewTopVis|Line < 0|
|00003900| 29 09 09 09 09 09 2f 2a | 20 63 6c 69 70 20 74 6f |)...../*| clip to|
|00003910| 20 72 61 6e 67 65 20 2a | 2f 0d 20 20 20 20 09 6e | range *|/. .n|
|00003920| 65 77 54 6f 70 56 69 73 | 4c 69 6e 65 20 3d 20 30 |ewTopVis|Line = 0|
|00003930| 3b 0d 20 20 20 20 69 66 | 20 28 6e 65 77 54 6f 70 |;. if| (newTop|
|00003940| 56 69 73 4c 69 6e 65 20 | 3e 20 47 65 74 43 74 6c |VisLine |> GetCtl|
|00003950| 4d 61 78 20 28 73 63 72 | 6f 6c 6c 29 29 0d 09 09 |Max (scr|oll))...|
|00003960| 6e 65 77 54 6f 70 56 69 | 73 4c 69 6e 65 20 3d 20 |newTopVi|sLine = |
|00003970| 47 65 74 43 74 6c 4d 61 | 78 20 28 73 63 72 6f 6c |GetCtlMa|x (scrol|
|00003980| 6c 29 3b 0d 20 20 20 20 | 53 65 74 53 63 72 6f 6c |l);. |SetScrol|
|00003990| 6c 56 61 6c 75 65 20 28 | 73 63 72 6f 6c 6c 2c 20 |lValue (|scroll, |
|000039a0| 6e 65 77 54 6f 70 56 69 | 73 4c 69 6e 65 29 3b 0d |newTopVi|sLine);.|
|000039b0| 20 20 20 20 54 45 53 63 | 72 6f 6c 6c 20 28 30 2c | TESc|roll (0,|
|000039c0| 20 28 74 6f 70 56 69 73 | 4c 69 6e 65 20 2d 20 6e | (topVis|Line - n|
|000039d0| 65 77 54 6f 70 56 69 73 | 4c 69 6e 65 20 29 20 2a |ewTopVis|Line ) *|
|000039e0| 20 28 2a 2a 68 54 45 29 | 2e 6c 69 6e 65 48 65 69 | (**hTE)|.lineHei|
|000039f0| 67 68 74 2c 20 68 54 45 | 29 3b 0d 7d 0d 0d 0d 2f |ght, hTE|);.}.../|
|00003a00| 2a 0d 20 2a 20 53 63 72 | 6f 6c 6c 20 74 6f 20 68 |*. * Scr|oll to h|
|00003a10| 6f 6d 65 20 70 6f 73 69 | 74 69 6f 6e 20 77 69 74 |ome posi|tion wit|
|00003a20| 68 6f 75 74 20 72 65 64 | 72 61 77 69 6e 67 2e 0d |hout red|rawing..|
|00003a30| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 76 6f 69 64 | */..sta|tic void|
|00003a40| 0d 53 63 72 6f 6c 6c 54 | 6f 48 6f 6d 65 20 28 54 |.ScrollT|oHome (T|
|00003a50| 45 48 61 6e 64 6c 65 20 | 68 54 45 29 0d 7b 0d 52 |EHandle |hTE).{.R|
|00003a60| 65 63 74 09 72 3b 0d 0d | 09 72 20 3d 20 28 2a 2a |ect.r;..|.r = (**|
|00003a70| 68 54 45 29 2e 64 65 73 | 74 52 65 63 74 3b 0d 09 |hTE).des|tRect;..|
|00003a80| 4f 66 66 73 65 74 52 65 | 63 74 20 28 26 72 2c 20 |OffsetRe|ct (&r, |
|00003a90| 30 2c 20 32 20 2d 20 72 | 2e 74 6f 70 29 3b 0d 09 |0, 2 - r|.top);..|
|00003aa0| 28 2a 2a 68 54 45 29 2e | 64 65 73 74 52 65 63 74 |(**hTE).|destRect|
|00003ab0| 20 3d 20 72 3b 0d 7d 0d | 0d 0d 2f 2a 0d 20 2a 20 | = r;.}.|../*. * |
|00003ac0| 43 6c 69 6b 4c 6f 6f 70 | 20 70 72 6f 63 20 66 6f |ClikLoop| proc fo|
|00003ad0| 72 20 61 75 74 6f 73 63 | 72 6f 6c 6c 69 6e 67 20 |r autosc|rolling |
|00003ae0| 74 65 78 74 20 77 68 65 | 6e 20 74 68 65 20 6d 6f |text whe|n the mo|
|00003af0| 75 73 65 20 69 73 20 64 | 72 61 67 67 65 64 20 6f |use is d|ragged o|
|00003b00| 75 74 0d 20 2a 20 6f 66 | 20 74 68 65 20 74 65 78 |ut. * of| the tex|
|00003b10| 74 20 76 69 65 77 20 72 | 65 63 74 61 6e 67 6c 65 |t view r|ectangle|
|00003b20| 2e 0d 20 2a 0d 20 2a 20 | 54 68 65 20 63 6c 69 70 |.. *. * |The clip|
|00003b30| 70 69 6e 67 20 72 65 67 | 69 6f 6e 20 68 61 73 20 |ping reg|ion has |
|00003b40| 74 6f 20 62 65 20 73 65 | 74 20 74 6f 20 69 6e 63 |to be se|t to inc|
|00003b50| 6c 75 64 65 20 74 68 65 | 20 73 63 72 6f 6c 6c 20 |lude the| scroll |
|00003b60| 62 61 72 2c 0d 20 2a 20 | 62 65 63 61 75 73 65 20 |bar,. * |because |
|00003b70| 77 68 65 6e 65 76 65 72 | 20 74 68 69 73 20 70 72 |whenever| this pr|
|00003b80| 6f 63 20 69 73 20 63 61 | 6c 6c 65 64 2c 20 54 65 |oc is ca|lled, Te|
|00003b90| 78 74 45 64 69 74 20 68 | 61 73 20 74 68 65 20 72 |xtEdit h|as the r|
|00003ba0| 65 67 69 6f 6e 20 73 65 | 74 0d 20 2a 20 74 6f 20 |egion se|t. * to |
|00003bb0| 74 68 65 20 76 69 65 77 | 20 72 65 63 74 61 6e 67 |the view| rectang|
|00003bc0| 6c 65 20 2d 20 69 66 20 | 69 74 27 73 20 6e 6f 74 |le - if |it's not|
|00003bd0| 20 72 65 73 65 74 2c 20 | 63 68 61 6e 67 65 73 20 | reset, |changes |
|00003be0| 74 6f 20 74 68 65 20 73 | 63 72 6f 6c 6c 0d 20 2a |to the s|croll. *|
|00003bf0| 20 62 61 72 20 77 6f 6e | 27 74 20 73 68 6f 77 20 | bar won|'t show |
|00003c00| 75 70 21 0d 20 2a 0d 20 | 2a 20 41 75 74 6f 53 63 |up!. *. |* AutoSc|
|00003c10| 72 6f 6c 6c 28 29 20 75 | 73 65 73 20 73 63 72 6f |roll() u|ses scro|
|00003c20| 6c 6c 44 6f 63 2c 20 77 | 68 69 63 68 20 6d 75 73 |llDoc, w|hich mus|
|00003c30| 74 20 62 65 20 73 65 74 | 20 69 6e 20 4d 6f 75 73 |t be set| in Mous|
|00003c40| 65 28 29 20 62 65 66 6f | 72 65 0d 20 2a 20 63 61 |e() befo|re. * ca|
|00003c50| 6c 6c 69 6e 67 20 54 45 | 43 6c 69 63 6b 28 29 2c |lling TE|Click(),|
|00003c60| 20 77 68 69 63 68 20 63 | 61 6c 6c 73 20 41 75 74 | which c|alls Aut|
|00003c70| 6f 53 63 72 6f 6c 6c 28 | 29 2e 0d 20 2a 2f 0d 0d |oScroll(|).. */..|
|00003c80| 0d 73 74 61 74 69 63 20 | 44 6f 63 48 61 6e 64 6c |.static |DocHandl|
|00003c90| 65 09 73 63 72 6f 6c 6c | 44 6f 63 3b 0d 73 74 61 |e.scroll|Doc;.sta|
|00003ca0| 74 69 63 20 73 68 6f 72 | 74 09 09 73 63 72 6f 6c |tic shor|t..scrol|
|00003cb0| 6c 50 61 72 74 3b 0d 0d | 73 74 61 74 69 63 20 70 |lPart;..|static p|
|00003cc0| 61 73 63 61 6c 20 42 6f | 6f 6c 65 61 6e 0d 41 75 |ascal Bo|olean.Au|
|00003cd0| 74 6f 53 63 72 6f 6c 6c | 20 28 76 6f 69 64 29 0d |toScroll| (void).|
|00003ce0| 7b 0d 57 69 6e 64 6f 77 | 50 74 72 09 77 3b 0d 54 |{.Window|Ptr.w;.T|
|00003cf0| 45 48 61 6e 64 6c 65 09 | 68 54 45 3b 0d 50 6f 69 |EHandle.|hTE;.Poi|
|00003d00| 6e 74 09 70 3b 0d 52 65 | 63 74 09 72 3b 0d 0d 09 |nt.p;.Re|ct.r;...|
|00003d10| 77 20 3d 20 44 6f 63 57 | 69 6e 64 20 28 73 63 72 |w = DocW|ind (scr|
|00003d20| 6f 6c 6c 44 6f 63 29 3b | 0d 09 68 54 45 20 3d 20 |ollDoc);|..hTE = |
|00003d30| 44 6f 63 54 45 20 28 73 | 63 72 6f 6c 6c 44 6f 63 |DocTE (s|crollDoc|
|00003d40| 29 3b 0d 0d 09 53 61 76 | 65 43 6c 69 70 52 67 6e |);...Sav|eClipRgn|
|00003d50| 20 28 29 3b 0d 09 43 6c | 69 70 52 65 63 74 20 28 | ();..Cl|ipRect (|
|00003d60| 26 77 2d 3e 70 6f 72 74 | 52 65 63 74 29 3b 0d 09 |&w->port|Rect);..|
|00003d70| 47 65 74 4d 6f 75 73 65 | 20 28 26 70 29 3b 0d 09 |GetMouse| (&p);..|
|00003d80| 72 20 3d 20 28 2a 2a 68 | 54 45 29 2e 76 69 65 77 |r = (**h|TE).view|
|00003d90| 52 65 63 74 3b 0d 09 69 | 66 20 28 70 2e 76 20 3c |Rect;..i|f (p.v <|
|00003da0| 20 72 2e 74 6f 70 29 0d | 09 09 53 63 72 6f 6c 6c | r.top).|..Scroll|
|00003db0| 54 65 78 74 20 28 73 63 | 72 6f 6c 6c 44 6f 63 2c |Text (sc|rollDoc,|
|00003dc0| 20 2d 31 29 3b 09 2f 2a | 20 62 61 63 6b 20 6f 6e | -1);./*| back on|
|00003dd0| 65 20 6c 69 6e 65 20 2a | 2f 0d 09 65 6c 73 65 20 |e line *|/..else |
|00003de0| 69 66 20 28 70 2e 76 20 | 3e 20 72 2e 62 6f 74 74 |if (p.v |> r.bott|
|00003df0| 6f 6d 29 0d 09 09 53 63 | 72 6f 6c 6c 54 65 78 74 |om)...Sc|rollText|
|00003e00| 20 28 73 63 72 6f 6c 6c | 44 6f 63 2c 20 31 29 3b | (scroll|Doc, 1);|
|00003e10| 09 2f 2a 20 66 6f 72 77 | 61 72 64 20 6f 6e 65 20 |./* forw|ard one |
|00003e20| 6c 69 6e 65 20 2a 2f 0d | 09 52 65 73 74 6f 72 65 |line */.|.Restore|
|00003e30| 43 6c 69 70 52 67 6e 20 | 28 29 3b 0d 09 72 65 74 |ClipRgn |();..ret|
|00003e40| 75 72 6e 20 28 74 72 75 | 65 29 3b 09 09 09 2f 2a |urn (tru|e);.../*|
|00003e50| 20 74 72 75 65 20 3d 20 | 27 6b 65 65 70 20 74 72 | true = |'keep tr|
|00003e60| 61 63 6b 69 6e 67 20 6d | 6f 75 73 65 27 20 2a 2f |acking m|ouse' */|
|00003e70| 0d 7d 0d 0d 0d 2f 2a 0d | 20 2a 20 46 69 6c 74 65 |.}.../*.| * Filte|
|00003e80| 72 20 70 72 6f 63 20 66 | 6f 72 20 74 72 61 63 6b |r proc f|or track|
|00003e90| 69 6e 67 20 6d 6f 75 73 | 65 64 6f 77 6e 20 69 6e |ing mous|edown in|
|00003ea0| 20 73 63 72 6f 6c 6c 20 | 62 61 72 2e 0d 20 2a 0d | scroll |bar.. *.|
|00003eb0| 20 2a 20 49 20 73 75 73 | 70 65 63 74 20 6f 64 64 | * I sus|pect odd|
|00003ec0| 20 73 63 72 6f 6c 6c 69 | 6e 67 20 6d 61 79 20 6f | scrolli|ng may o|
|00003ed0| 63 63 75 72 20 66 6f 72 | 20 68 69 74 73 20 69 6e |ccur for| hits in|
|00003ee0| 20 70 61 67 69 6e 67 20 | 72 65 67 69 6f 6e 73 20 | paging |regions |
|00003ef0| 69 66 0d 20 2a 20 74 68 | 65 20 77 69 6e 64 6f 77 |if. * th|e window|
|00003f00| 20 69 73 20 61 6c 6c 6f | 77 65 64 20 74 6f 20 73 | is allo|wed to s|
|00003f10| 69 7a 65 20 73 75 63 68 | 20 74 68 61 74 20 6c 65 |ize such| that le|
|00003f20| 73 73 20 74 68 61 6e 20 | 74 77 6f 20 6c 69 6e 65 |ss than |two line|
|00003f30| 73 20 73 68 6f 77 2e 0d | 20 2a 0d 20 2a 20 54 72 |s show..| *. * Tr|
|00003f40| 61 63 6b 53 63 72 6f 6c | 6c 28 29 20 75 73 65 73 |ackScrol|l() uses|
|00003f50| 20 73 63 72 6f 6c 6c 44 | 6f 63 20 61 6e 64 20 73 | scrollD|oc and s|
|00003f60| 63 72 6f 6c 6c 50 61 72 | 74 2c 20 77 68 69 63 68 |crollPar|t, which|
|00003f70| 20 6d 75 73 74 20 62 65 | 20 73 65 74 20 69 6e 0d | must be| set in.|
|00003f80| 20 2a 20 4d 6f 75 73 65 | 28 29 20 62 65 66 6f 72 | * Mouse|() befor|
|00003f90| 65 20 63 61 6c 6c 69 6e | 67 20 54 72 61 63 6b 43 |e callin|g TrackC|
|00003fa0| 6f 6e 74 72 6f 6c 28 29 | 2c 20 77 68 69 63 68 20 |ontrol()|, which |
|00003fb0| 63 61 6c 6c 73 20 54 72 | 61 63 6b 53 63 72 6f 6c |calls Tr|ackScrol|
|00003fc0| 6c 28 29 2e 0d 20 2a 20 | 73 63 72 6f 6c 6c 50 61 |l().. * |scrollPa|
|00003fd0| 72 74 20 69 73 20 74 68 | 65 20 6f 72 69 67 69 6e |rt is th|e origin|
|00003fe0| 61 6c 20 70 61 72 74 20 | 63 6f 64 65 20 69 6e 20 |al part |code in |
|00003ff0| 77 68 69 63 68 20 74 68 | 65 20 6d 6f 75 73 65 64 |which th|e moused|
|00004000| 6f 77 6e 20 6f 63 63 75 | 72 72 65 64 2e 0d 20 2a |own occu|rred.. *|
|00004010| 2f 0d 0d 73 74 61 74 69 | 63 20 70 61 73 63 61 6c |/..stati|c pascal|
|00004020| 20 76 6f 69 64 0d 54 72 | 61 63 6b 53 63 72 6f 6c | void.Tr|ackScrol|
|00004030| 6c 20 28 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |l (Contr|olHandle|
|00004040| 20 74 68 65 53 63 72 6f | 6c 6c 2c 20 73 68 6f 72 | theScro|ll, shor|
|00004050| 74 20 70 61 72 74 43 6f | 64 65 29 0d 7b 0d 73 68 |t partCo|de).{.sh|
|00004060| 6f 72 74 09 6c 44 65 6c | 74 61 3b 0d 73 68 6f 72 |ort.lDel|ta;.shor|
|00004070| 74 09 76 69 73 4c 69 6e | 65 73 20 3d 20 44 6f 63 |t.visLin|es = Doc|
|00004080| 56 69 73 4c 69 6e 65 73 | 20 28 73 63 72 6f 6c 6c |VisLines| (scroll|
|00004090| 44 6f 63 29 3b 0d 0d 20 | 20 20 20 69 66 20 28 70 |Doc);.. | if (p|
|000040a0| 61 72 74 43 6f 64 65 20 | 3d 3d 20 73 63 72 6f 6c |artCode |== scrol|
|000040b0| 6c 50 61 72 74 29 09 2f | 2a 20 73 74 69 6c 6c 20 |lPart)./|* still |
|000040c0| 69 6e 20 73 61 6d 65 20 | 70 61 72 74 3f 20 2a 2f |in same |part? */|
|000040d0| 0d 20 20 20 20 7b 0d 20 | 20 20 20 20 20 20 20 73 |. {. | s|
|000040e0| 77 69 74 63 68 20 28 70 | 61 72 74 43 6f 64 65 29 |witch (p|artCode)|
|000040f0| 0d 20 20 20 20 20 20 20 | 20 7b 0d 20 20 20 20 20 |. | {. |
|00004100| 20 20 20 20 20 20 20 63 | 61 73 65 20 69 6e 55 70 | c|ase inUp|
|00004110| 42 75 74 74 6f 6e 3a 20 | 6c 44 65 6c 74 61 20 3d |Button: |lDelta =|
|00004120| 20 2d 31 3b 20 62 72 65 | 61 6b 3b 0d 20 20 20 20 | -1; bre|ak;. |
|00004130| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 69 6e 44 | |case inD|
|00004140| 6f 77 6e 42 75 74 74 6f | 6e 3a 20 6c 44 65 6c 74 |ownButto|n: lDelt|
|00004150| 61 20 3d 20 31 3b 20 62 | 72 65 61 6b 3b 0d 20 20 |a = 1; b|reak;. |
|00004160| 20 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 69 | | case i|
|00004170| 6e 50 61 67 65 55 70 3a | 20 6c 44 65 6c 74 61 20 |nPageUp:| lDelta |
|00004180| 3d 20 2d 28 76 69 73 4c | 69 6e 65 73 20 2d 20 31 |= -(visL|ines - 1|
|00004190| 29 3b 20 62 72 65 61 6b | 3b 0d 20 20 20 20 20 20 |); break|;. |
|000041a0| 20 20 20 20 20 20 63 61 | 73 65 20 69 6e 50 61 67 | ca|se inPag|
|000041b0| 65 44 6f 77 6e 3a 20 6c | 44 65 6c 74 61 20 3d 20 |eDown: l|Delta = |
|000041c0| 76 69 73 4c 69 6e 65 73 | 20 2d 20 31 3b 20 62 72 |visLines| - 1; br|
|000041d0| 65 61 6b 3b 0d 20 20 20 | 20 20 20 20 20 7d 0d 20 |eak;. | }. |
|000041e0| 20 20 20 20 20 20 20 53 | 63 72 6f 6c 6c 54 65 78 | S|crollTex|
|000041f0| 74 20 28 73 63 72 6f 6c | 6c 44 6f 63 2c 20 6c 44 |t (scrol|lDoc, lD|
|00004200| 65 6c 74 61 29 3b 0d 20 | 20 20 20 7d 0d 7d 0d 0d |elta);. | }.}..|
|00004210| 0d 2f 2a 0d 20 2a 20 53 | 65 74 20 74 68 65 20 73 |./*. * S|et the s|
|00004220| 63 72 6f 6c 6c 20 62 61 | 72 20 70 72 6f 70 65 72 |croll ba|r proper|
|00004230| 6c 79 20 61 6e 64 20 61 | 64 6a 75 73 74 20 74 68 |ly and a|djust th|
|00004240| 65 20 74 65 78 74 20 69 | 6e 20 74 68 65 0d 20 2a |e text i|n the. *|
|00004250| 20 77 69 6e 64 6f 77 20 | 73 6f 20 74 68 61 74 20 | window |so that |
|00004260| 74 68 65 20 6c 69 6e 65 | 20 63 6f 6e 74 61 69 6e |the line| contain|
|00004270| 69 6e 67 20 74 68 65 20 | 63 61 72 65 74 20 69 73 |ing the |caret is|
|00004280| 20 76 69 73 69 62 6c 65 | 2e 0d 20 2a 20 49 66 20 | visible|.. * If |
|00004290| 74 68 65 20 6c 69 6e 65 | 20 77 69 74 68 20 74 68 |the line| with th|
|000042a0| 65 20 63 61 72 65 74 20 | 69 73 20 6d 6f 72 65 20 |e caret |is more |
|000042b0| 74 68 61 6e 20 61 20 6c | 69 6e 65 20 6f 75 74 73 |than a l|ine outs|
|000042c0| 69 64 65 20 6f 66 0d 20 | 2a 20 74 68 65 20 76 69 |ide of. |* the vi|
|000042d0| 65 77 52 65 63 74 2c 20 | 74 72 79 20 74 6f 20 70 |ewRect, |try to p|
|000042e0| 6c 61 63 65 20 69 74 20 | 69 6e 20 74 68 65 20 6d |lace it |in the m|
|000042f0| 69 64 64 6c 65 20 6f 66 | 20 74 68 65 20 77 69 6e |iddle of| the win|
|00004300| 64 6f 77 2e 0d 20 2a 0d | 20 2a 20 59 65 73 2c 20 |dow.. *.| * Yes, |
|00004310| 69 74 20 69 73 20 6e 65 | 63 65 73 73 61 72 79 20 |it is ne|cessary |
|00004320| 74 6f 20 63 61 6c 6c 20 | 53 65 74 53 63 72 6f 6c |to call |SetScrol|
|00004330| 6c 4d 61 78 28 29 20 61 | 74 20 74 68 65 20 65 6e |lMax() a|t the en|
|00004340| 64 2e 0d 20 2a 2f 0d 0d | 73 74 61 74 69 63 20 76 |d.. */..|static v|
|00004350| 6f 69 64 0d 41 64 6a 75 | 73 74 44 69 73 70 6c 61 |oid.Adju|stDispla|
|00004360| 79 20 28 44 6f 63 48 61 | 6e 64 6c 65 20 64 6f 63 |y (DocHa|ndle doc|
|00004370| 29 0d 7b 0d 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |).{.Cont|rolHandl|
|00004380| 65 09 73 63 72 6f 6c 6c | 3b 0d 54 45 48 61 6e 64 |e.scroll|;.TEHand|
|00004390| 6c 65 09 68 54 45 3b 0d | 73 68 6f 72 74 09 09 76 |le.hTE;.|short..v|
|000043a0| 69 73 4c 69 6e 65 73 3b | 0d 73 68 6f 72 74 09 63 |isLines;|.short.c|
|000043b0| 61 72 65 74 4c 69 6e 65 | 3b 0d 73 68 6f 72 74 09 |aretLine|;.short.|
|000043c0| 74 6f 70 56 69 73 4c 69 | 6e 65 3b 0d 73 68 6f 72 |topVisLi|ne;.shor|
|000043d0| 74 09 64 3b 0d 0d 09 73 | 63 72 6f 6c 6c 20 3d 20 |t.d;...s|croll = |
|000043e0| 44 6f 63 53 63 72 6f 6c | 6c 20 28 64 6f 63 29 3b |DocScrol|l (doc);|
|000043f0| 0d 09 68 54 45 20 3d 20 | 44 6f 63 54 45 20 28 64 |..hTE = |DocTE (d|
|00004400| 6f 63 29 3b 0d 09 76 69 | 73 4c 69 6e 65 73 20 3d |oc);..vi|sLines =|
|00004410| 20 44 6f 63 56 69 73 4c | 69 6e 65 73 20 28 64 6f | DocVisL|ines (do|
|00004420| 63 29 3b 0d 0d 09 53 65 | 74 53 63 72 6f 6c 6c 4d |c);...Se|tScrollM|
|00004430| 61 78 20 28 64 6f 63 29 | 3b 0d 09 63 61 72 65 74 |ax (doc)|;..caret|
|00004440| 4c 69 6e 65 20 3d 20 4c | 69 6e 65 57 69 74 68 43 |Line = L|ineWithC|
|00004450| 61 72 65 74 20 28 68 54 | 45 29 3b 0d 09 74 6f 70 |aret (hT|E);..top|
|00004460| 56 69 73 4c 69 6e 65 20 | 3d 20 4c 69 6e 65 73 4f |VisLine |= LinesO|
|00004470| 66 66 54 6f 70 20 28 68 | 54 45 29 3b 0d 09 69 66 |ffTop (h|TE);..if|
|00004480| 20 28 28 64 20 3d 20 63 | 61 72 65 74 4c 69 6e 65 | ((d = c|aretLine|
|00004490| 20 2d 20 74 6f 70 56 69 | 73 4c 69 6e 65 29 20 3c | - topVi|sLine) <|
|000044a0| 20 30 29 0d 09 09 53 63 | 72 6f 6c 6c 54 65 78 74 | 0)...Sc|rollText|
|000044b0| 20 28 64 6f 63 2c 20 64 | 20 3d 3d 20 2d 31 20 3f | (doc, d| == -1 ?|
|000044c0| 20 2d 31 20 3a 20 64 20 | 2d 20 76 69 73 4c 69 6e | -1 : d |- visLin|
|000044d0| 65 73 20 2f 20 32 29 3b | 0d 09 65 6c 73 65 20 69 |es / 2);|..else i|
|000044e0| 66 20 28 28 20 64 20 3d | 20 63 61 72 65 74 4c 69 |f (( d =| caretLi|
|000044f0| 6e 65 20 2d 20 28 74 6f | 70 56 69 73 4c 69 6e 65 |ne - (to|pVisLine|
|00004500| 20 2b 20 76 69 73 4c 69 | 6e 65 73 20 2d 20 31 29 | + visLi|nes - 1)|
|00004510| 29 20 3e 20 30 29 0d 09 | 09 53 63 72 6f 6c 6c 54 |) > 0)..|.ScrollT|
|00004520| 65 78 74 20 28 64 6f 63 | 2c 20 64 20 3d 3d 20 31 |ext (doc|, d == 1|
|00004530| 20 3f 20 31 20 3a 20 64 | 20 2b 20 76 69 73 4c 69 | ? 1 : d| + visLi|
|00004540| 6e 65 73 20 2f 20 32 29 | 3b 0d 09 65 6c 73 65 0d |nes / 2)|;..else.|
|00004550| 09 09 53 65 74 53 63 72 | 6f 6c 6c 56 61 6c 75 65 |..SetScr|ollValue|
|00004560| 20 28 73 63 72 6f 6c 6c | 2c 20 74 6f 70 56 69 73 | (scroll|, topVis|
|00004570| 4c 69 6e 65 29 3b 0d 09 | 53 65 74 53 63 72 6f 6c |Line);..|SetScrol|
|00004580| 6c 4d 61 78 20 28 64 6f | 63 29 3b 09 2f 2a 20 6d |lMax (do|c);./* m|
|00004590| 69 67 68 74 20 68 61 76 | 65 20 63 68 61 6e 67 65 |ight hav|e change|
|000045a0| 64 20 66 72 6f 6d 20 73 | 63 72 6f 6c 6c 69 6e 67 |d from s|crolling|
|000045b0| 20 2a 2f 0d 7d 0d 0d 0d | 2f 2a 0d 20 2a 20 4f 76 | */.}...|/*. * Ov|
|000045c0| 65 72 68 61 75 6c 20 74 | 68 65 20 65 6e 74 69 72 |erhaul t|he entir|
|000045d0| 65 20 64 69 73 70 6c 61 | 79 2e 20 20 54 68 69 73 |e displa|y. This|
|000045e0| 20 69 73 20 63 61 6c 6c | 65 64 20 61 66 74 65 72 | is call|ed after|
|000045f0| 20 63 61 74 61 73 74 72 | 6f 70 68 69 63 0d 20 2a | catastr|ophic. *|
|00004600| 20 65 76 65 6e 74 73 2c | 20 73 75 63 68 20 61 73 | events,| such as|
|00004610| 20 72 65 73 69 7a 69 6e | 67 20 74 68 65 20 77 69 | resizin|g the wi|
|00004620| 6e 64 6f 77 2c 20 6f 72 | 20 63 68 61 6e 67 65 73 |ndow, or| changes|
|00004630| 20 74 6f 20 74 68 65 20 | 77 6f 72 64 0d 20 2a 20 | to the |word. * |
|00004640| 77 72 61 70 20 73 74 79 | 6c 65 2e 20 20 49 74 20 |wrap sty|le. It |
|00004650| 6d 61 6b 65 73 20 73 75 | 72 65 20 74 68 65 20 76 |makes su|re the v|
|00004660| 69 65 77 20 61 6e 64 20 | 64 65 73 74 69 6e 61 74 |iew and |destinat|
|00004670| 69 6f 6e 20 72 65 63 74 | 61 6e 67 6c 65 73 0d 20 |ion rect|angles. |
|00004680| 2a 20 61 72 65 20 73 69 | 7a 65 64 20 70 72 6f 70 |* are si|zed prop|
|00004690| 65 72 6c 79 2c 20 61 6e | 64 20 74 68 61 74 20 74 |erly, an|d that t|
|000046a0| 68 65 20 62 6f 74 74 6f | 6d 20 6c 69 6e 65 20 6f |he botto|m line o|
|000046b0| 66 20 74 65 78 74 20 6e | 65 76 65 72 0d 20 2a 20 |f text n|ever. * |
|000046c0| 73 63 72 6f 6c 6c 73 20 | 75 70 20 70 61 73 74 20 |scrolls |up past |
|000046d0| 74 68 65 20 62 6f 74 74 | 6f 6d 20 6c 69 6e 65 20 |the bott|om line |
|000046e0| 6f 66 20 74 68 65 20 77 | 69 6e 64 6f 77 20 28 69 |of the w|indow (i|
|000046f0| 66 20 74 68 65 72 65 27 | 73 0d 20 2a 20 65 6e 6f |f there'|s. * eno|
|00004700| 75 67 68 20 74 6f 20 66 | 69 6c 6c 20 74 68 65 20 |ugh to f|ill the |
|00004710| 77 69 6e 64 6f 77 29 2c | 20 61 6e 64 20 74 68 61 |window),| and tha|
|00004720| 74 20 74 68 65 20 73 63 | 72 6f 6c 6c 20 62 61 72 |t the sc|roll bar|
|00004730| 20 6d 61 78 20 61 6e 64 | 0d 20 2a 20 63 75 72 72 | max and|. * curr|
|00004740| 65 6e 74 20 76 61 6c 75 | 65 73 20 61 72 65 20 73 |ent valu|es are s|
|00004750| 65 74 20 70 72 6f 70 65 | 72 6c 79 2e 0d 20 2a 0d |et prope|rly.. *.|
|00004760| 20 2a 20 52 65 73 69 7a | 69 6e 67 20 74 68 65 20 | * Resiz|ing the |
|00004770| 64 65 73 74 20 72 65 63 | 74 20 6a 75 73 74 20 6d |dest rec|t just m|
|00004780| 65 61 6e 73 20 72 65 73 | 65 74 74 69 6e 67 20 74 |eans res|etting t|
|00004790| 68 65 20 72 69 67 68 74 | 20 65 64 67 65 0d 20 2a |he right| edge. *|
|000047a0| 20 28 74 68 65 20 74 6f | 70 20 69 73 20 4e 4f 54 | (the to|p is NOT|
|000047b0| 20 72 65 73 65 74 29 2c | 20 73 69 6e 63 65 20 74 | reset),| since t|
|000047c0| 65 78 74 20 6d 69 67 68 | 74 20 62 65 20 73 63 72 |ext migh|t be scr|
|000047d0| 6f 6c 6c 65 64 20 6f 66 | 66 20 74 68 65 0d 20 2a |olled of|f the. *|
|000047e0| 20 74 6f 70 20 28 69 2e | 65 2e 2c 20 64 65 73 74 | top (i.|e., dest|
|000047f0| 52 65 63 74 2e 74 6f 70 | 20 21 3d 20 30 29 2e 0d |Rect.top| != 0)..|
|00004800| 20 2a 0d 20 2a 20 44 6f | 65 73 6e 27 74 20 72 65 | *. * Do|esn't re|
|00004810| 64 72 61 77 20 74 68 65 | 20 63 6f 6e 74 72 6f 6c |draw the| control|
|00004820| 2c 20 74 68 6f 75 67 68 | 21 0d 20 2a 2f 0d 0d 73 |, though|!. */..s|
|00004830| 74 61 74 69 63 20 76 6f | 69 64 0d 4f 76 65 72 68 |tatic vo|id.Overh|
|00004840| 61 75 6c 44 69 73 70 6c | 61 79 20 28 44 6f 63 48 |aulDispl|ay (DocH|
|00004850| 61 6e 64 6c 65 20 64 6f | 63 2c 20 42 6f 6f 6c 65 |andle do|c, Boole|
|00004860| 61 6e 20 73 68 6f 77 43 | 61 72 65 74 2c 20 42 6f |an showC|aret, Bo|
|00004870| 6f 6c 65 61 6e 20 72 65 | 63 61 6c 63 29 0d 7b 0d |olean re|calc).{.|
|00004880| 54 45 48 61 6e 64 6c 65 | 09 68 54 45 3b 0d 52 65 |TEHandle|.hTE;.Re|
|00004890| 63 74 09 09 72 3b 0d 0d | 09 68 54 45 20 3d 20 44 |ct..r;..|.hTE = D|
|000048a0| 6f 63 54 45 20 28 64 6f | 63 29 3b 0d 09 72 20 3d |ocTE (do|c);..r =|
|000048b0| 20 28 2a 2a 68 54 45 29 | 2e 76 69 65 77 52 65 63 | (**hTE)|.viewRec|
|000048c0| 74 3b 09 09 2f 2a 20 65 | 72 61 73 65 20 63 75 72 |t;../* e|rase cur|
|000048d0| 72 65 6e 74 20 76 69 65 | 77 52 65 63 74 20 2a 2f |rent vie|wRect */|
|000048e0| 0d 09 45 72 61 73 65 52 | 65 63 74 20 28 26 72 29 |..EraseR|ect (&r)|
|000048f0| 3b 0d 09 43 61 6c 63 45 | 64 69 74 52 65 63 74 20 |;..CalcE|ditRect |
|00004900| 28 44 6f 63 57 69 6e 64 | 20 28 64 6f 63 29 2c 20 |(DocWind| (doc), |
|00004910| 26 72 29 3b 09 09 2f 2a | 20 63 61 6c 63 75 6c 61 |&r);../*| calcula|
|00004920| 74 65 20 6e 65 77 20 76 | 69 65 77 52 65 63 74 20 |te new v|iewRect |
|00004930| 2a 2f 0d 09 28 2a 2a 68 | 54 45 29 2e 64 65 73 74 |*/..(**h|TE).dest|
|00004940| 52 65 63 74 2e 72 69 67 | 68 74 20 3d 20 72 2e 72 |Rect.rig|ht = r.r|
|00004950| 69 67 68 74 3b 0d 09 28 | 2a 2a 68 54 45 29 2e 76 |ight;..(|**hTE).v|
|00004960| 69 65 77 52 65 63 74 20 | 3d 20 72 3b 0d 09 69 66 |iewRect |= r;..if|
|00004970| 20 28 72 65 63 61 6c 63 | 29 0d 09 09 54 45 43 61 | (recalc|)...TECa|
|00004980| 6c 54 65 78 74 20 28 68 | 54 45 29 3b 09 09 09 2f |lText (h|TE);.../|
|00004990| 2a 20 72 65 63 61 6c 63 | 75 6c 61 74 65 20 6c 69 |* recalc|ulate li|
|000049a0| 6e 65 20 73 74 61 72 74 | 73 20 2a 2f 0d 09 44 6f |ne start|s */..Do|
|000049b0| 63 56 69 73 4c 69 6e 65 | 73 20 28 64 6f 63 29 20 |cVisLine|s (doc) |
|000049c0| 3d 20 28 72 2e 62 6f 74 | 74 6f 6d 20 2d 20 72 2e |= (r.bot|tom - r.|
|000049d0| 74 6f 70 29 20 2f 20 28 | 2a 2a 68 54 45 29 2e 6c |top) / (|**hTE).l|
|000049e0| 69 6e 65 48 65 69 67 68 | 74 3b 0d 0d 09 2f 2a 0d |ineHeigh|t;.../*.|
|000049f0| 09 20 2a 20 49 66 20 74 | 68 65 72 65 20 69 73 20 |. * If t|here is |
|00004a00| 74 65 78 74 2c 20 62 75 | 74 20 6e 6f 6e 65 20 6f |text, bu|t none o|
|00004a10| 66 20 69 74 20 69 73 20 | 76 69 73 69 62 6c 65 20 |f it is |visible |
|00004a20| 69 6e 20 74 68 65 20 77 | 69 6e 64 6f 77 0d 09 20 |in the w|indow.. |
|00004a30| 2a 20 28 69 74 27 73 20 | 61 6c 6c 20 73 63 72 6f |* (it's |all scro|
|00004a40| 6c 6c 65 64 20 6f 66 66 | 20 74 68 65 20 74 6f 70 |lled off| the top|
|00004a50| 29 2c 20 70 75 6c 6c 20 | 73 6f 6d 65 20 64 6f 77 |), pull |some dow|
|00004a60| 6e 2e 0d 09 20 2a 2f 0d | 0d 09 69 66 20 28 73 68 |n... */.|..if (sh|
|00004a70| 6f 77 43 61 72 65 74 29 | 0d 09 09 41 64 6a 75 73 |owCaret)|...Adjus|
|00004a80| 74 44 69 73 70 6c 61 79 | 20 28 64 6f 63 29 3b 0d |tDisplay| (doc);.|
|00004a90| 09 65 6c 73 65 0d 09 09 | 53 65 74 53 63 72 6f 6c |.else...|SetScrol|
|00004aa0| 6c 4d 61 78 20 28 64 6f | 63 29 3b 0d 0d 09 54 45 |lMax (do|c);...TE|
|00004ab0| 55 70 64 61 74 65 20 28 | 26 72 2c 20 68 54 45 29 |Update (|&r, hTE)|
|00004ac0| 3b 0d 7d 0d 0d 0d 2f 2a | 20 2d 2d 2d 2d 2d 2d 2d |;.}.../*| -------|
|00004ad0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004ae0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004af0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004b00| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 2a 2f 0d 2f 2a 09 |--------|- */./*.|
|00004b10| 09 09 09 09 09 57 69 6e | 64 6f 77 20 48 61 6e 64 |.....Win|dow Hand|
|00004b20| 6c 65 72 20 52 6f 75 74 | 69 6e 65 73 09 09 09 09 |ler Rout|ines....|
|00004b30| 09 09 2a 2f 0d 2f 2a 20 | 2d 2d 2d 2d 2d 2d 2d 2d |..*/./* |--------|
|00004b40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004b50| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004b60| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004b70| 2d 2d 2d 2d 2d 2d 2d 2d | 20 2a 2f 0d 0d 0d 2f 2a |--------| */.../*|
|00004b80| 0d 20 2a 20 48 61 6e 64 | 6c 65 20 6d 6f 75 73 65 |. * Hand|le mouse|
|00004b90| 20 63 6c 69 63 6b 73 20 | 69 6e 20 77 69 6e 64 6f | clicks |in windo|
|00004ba0| 77 2e 20 20 54 68 65 20 | 76 69 65 77 52 65 63 74 |w. The |viewRect|
|00004bb0| 20 69 73 20 6e 65 76 65 | 72 20 74 65 73 74 65 64 | is neve|r tested|
|00004bc0| 0d 20 2a 20 64 69 72 65 | 63 74 6c 79 2c 20 62 65 |. * dire|ctly, be|
|00004bd0| 63 61 75 73 65 20 69 66 | 20 69 74 20 77 65 72 65 |cause if| it were|
|00004be0| 2c 20 63 6c 69 63 6b 73 | 20 61 6c 6f 6e 67 20 74 |, clicks| along t|
|00004bf0| 68 65 20 74 6f 70 2c 20 | 6c 65 66 74 20 61 6e 64 |he top, |left and|
|00004c00| 0d 20 2a 20 62 6f 74 74 | 6f 6d 20 65 64 67 65 73 |. * bott|om edges|
|00004c10| 20 6f 66 20 74 68 65 20 | 77 69 6e 64 6f 77 20 77 | of the |window w|
|00004c20| 6f 75 6c 64 6e 27 74 20 | 72 65 67 69 73 74 65 72 |ouldn't |register|
|00004c30| 2e 0d 20 2a 2f 0d 0d 73 | 74 61 74 69 63 20 70 61 |.. */..s|tatic pa|
|00004c40| 73 63 61 6c 20 76 6f 69 | 64 0d 4d 6f 75 73 65 20 |scal voi|d.Mouse |
|00004c50| 28 50 6f 69 6e 74 20 74 | 68 65 50 74 2c 20 6c 6f |(Point t|hePt, lo|
|00004c60| 6e 67 20 74 2c 20 73 68 | 6f 72 74 20 6d 6f 64 73 |ng t, sh|ort mods|
|00004c70| 29 0d 7b 0d 57 69 6e 64 | 6f 77 50 74 72 09 77 3b |).{.Wind|owPtr.w;|
|00004c80| 0d 44 6f 63 48 61 6e 64 | 6c 65 09 64 6f 63 3b 0d |.DocHand|le.doc;.|
|00004c90| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 09 73 63 |ControlH|andle.sc|
|00004ca0| 72 6f 6c 6c 3b 0d 73 68 | 6f 72 74 09 74 68 65 50 |roll;.sh|ort.theP|
|00004cb0| 61 72 74 3b 0d 73 68 6f | 72 74 09 6f 6c 64 43 74 |art;.sho|rt.oldCt|
|00004cc0| 6c 56 61 6c 75 65 3b 0d | 0d 09 47 65 74 50 6f 72 |lValue;.|..GetPor|
|00004cd0| 74 20 28 26 77 29 3b 0d | 09 64 6f 63 20 3d 20 57 |t (&w);.|.doc = W|
|00004ce0| 69 6e 64 44 6f 63 48 61 | 6e 64 6c 65 20 28 77 29 |indDocHa|ndle (w)|
|00004cf0| 3b 0d 09 73 63 72 6f 6c | 6c 20 3d 20 44 6f 63 53 |;..scrol|l = DocS|
|00004d00| 63 72 6f 6c 6c 20 28 64 | 6f 63 29 3b 0d 0d 09 69 |croll (d|oc);...i|
|00004d10| 66 20 28 28 74 68 65 50 | 61 72 74 20 3d 20 54 65 |f ((theP|art = Te|
|00004d20| 73 74 43 6f 6e 74 72 6f | 6c 20 28 73 63 72 6f 6c |stContro|l (scrol|
|00004d30| 6c 2c 20 74 68 65 50 74 | 29 29 20 3d 3d 20 69 6e |l, thePt|)) == in|
|00004d40| 54 68 75 6d 62 29 0d 09 | 7b 0d 09 09 6f 6c 64 43 |Thumb)..|{...oldC|
|00004d50| 74 6c 56 61 6c 75 65 20 | 3d 20 47 65 74 43 74 6c |tlValue |= GetCtl|
|00004d60| 56 61 6c 75 65 20 28 73 | 63 72 6f 6c 6c 29 3b 0d |Value (s|croll);.|
|00004d70| 09 09 69 66 20 28 54 72 | 61 63 6b 43 6f 6e 74 72 |..if (Tr|ackContr|
|00004d80| 6f 6c 20 28 73 63 72 6f | 6c 6c 2c 20 74 68 65 50 |ol (scro|ll, theP|
|00004d90| 74 2c 20 6e 69 6c 29 20 | 3d 3d 20 69 6e 54 68 75 |t, nil) |== inThu|
|00004da0| 6d 62 29 0d 09 09 09 53 | 63 72 6f 6c 6c 54 65 78 |mb)....S|crollTex|
|00004db0| 74 20 28 64 6f 63 2c 20 | 47 65 74 43 74 6c 56 61 |t (doc, |GetCtlVa|
|00004dc0| 6c 75 65 20 28 73 63 72 | 6f 6c 6c 29 20 2d 20 6f |lue (scr|oll) - o|
|00004dd0| 6c 64 43 74 6c 56 61 6c | 75 65 29 3b 0d 09 7d 0d |ldCtlVal|ue);..}.|
|00004de0| 09 65 6c 73 65 20 69 66 | 20 28 74 68 65 50 61 72 |.else if| (thePar|
|00004df0| 74 20 21 3d 20 30 29 0d | 09 7b 0d 09 09 73 63 72 |t != 0).|.{...scr|
|00004e00| 6f 6c 6c 44 6f 63 20 3d | 20 64 6f 63 3b 09 09 2f |ollDoc =| doc;../|
|00004e10| 2a 20 73 65 74 20 67 6c | 6f 62 61 6c 73 20 66 6f |* set gl|obals fo|
|00004e20| 72 20 54 72 61 63 6b 53 | 63 72 6f 6c 6c 20 2a 2f |r TrackS|croll */|
|00004e30| 0d 09 09 73 63 72 6f 6c | 6c 50 61 72 74 20 3d 20 |...scrol|lPart = |
|00004e40| 74 68 65 50 61 72 74 3b | 0d 09 09 28 76 6f 69 64 |thePart;|...(void|
|00004e50| 29 20 54 72 61 63 6b 43 | 6f 6e 74 72 6f 6c 20 28 |) TrackC|ontrol (|
|00004e60| 73 63 72 6f 6c 6c 2c 20 | 74 68 65 50 74 2c 20 26 |scroll, |thePt, &|
|00004e70| 54 72 61 63 6b 53 63 72 | 6f 6c 6c 29 3b 0d 09 7d |TrackScr|oll);..}|
|00004e80| 0d 09 65 6c 73 65 20 69 | 66 20 28 50 74 49 6e 54 |..else i|f (PtInT|
|00004e90| 65 78 74 20 28 77 2c 20 | 74 68 65 50 74 29 29 0d |ext (w, |thePt)).|
|00004ea0| 09 7b 0d 09 09 73 63 72 | 6f 6c 6c 44 6f 63 20 3d |.{...scr|ollDoc =|
|00004eb0| 20 64 6f 63 3b 09 09 2f | 2a 20 73 65 74 20 67 6c | doc;../|* set gl|
|00004ec0| 6f 62 61 6c 20 66 6f 72 | 20 41 75 74 6f 53 63 72 |obal for| AutoScr|
|00004ed0| 6f 6c 6c 20 2a 2f 0d 09 | 09 54 45 43 6c 69 63 6b |oll */..|.TEClick|
|00004ee0| 20 28 74 68 65 50 74 2c | 20 28 6d 6f 64 73 20 26 | (thePt,| (mods &|
|00004ef0| 20 73 68 69 66 74 4b 65 | 79 29 20 21 3d 20 30 2c | shiftKe|y) != 0,|
|00004f00| 20 44 6f 63 54 45 20 28 | 64 6f 63 29 29 3b 0d 09 | DocTE (|doc));..|
|00004f10| 7d 0d 0d 09 53 65 74 53 | 63 72 6f 6c 6c 4d 61 78 |}...SetS|crollMax|
|00004f20| 20 28 64 6f 63 29 3b 0d | 7d 0d 0d 0d 2f 2a 0d 20 | (doc);.|}.../*. |
|00004f30| 2a 20 48 61 6e 64 6c 65 | 20 6b 65 79 20 63 6c 69 |* Handle| key cli|
|00004f40| 63 6b 73 20 69 6e 20 77 | 69 6e 64 6f 77 0d 20 2a |cks in w|indow. *|
|00004f50| 2f 0d 0d 73 74 61 74 69 | 63 20 70 61 73 63 61 6c |/..stati|c pascal|
|00004f60| 20 76 6f 69 64 0d 4b 65 | 79 20 28 73 68 6f 72 74 | void.Ke|y (short|
|00004f70| 20 63 2c 20 73 68 6f 72 | 74 20 63 6f 64 65 2c 20 | c, shor|t code, |
|00004f80| 73 68 6f 72 74 20 6d 6f | 64 73 29 0d 7b 0d 57 69 |short mo|ds).{.Wi|
|00004f90| 6e 64 6f 77 50 74 72 09 | 77 3b 0d 44 6f 63 48 61 |ndowPtr.|w;.DocHa|
|00004fa0| 6e 64 6c 65 09 64 6f 63 | 3b 0d 0d 09 47 65 74 50 |ndle.doc|;...GetP|
|00004fb0| 6f 72 74 20 28 26 77 29 | 3b 0d 09 64 6f 63 20 3d |ort (&w)|;..doc =|
|00004fc0| 20 57 69 6e 64 44 6f 63 | 48 61 6e 64 6c 65 20 28 | WindDoc|Handle (|
|00004fd0| 77 29 3b 0d 0d 09 69 66 | 20 28 63 20 21 3d 20 65 |w);...if| (c != e|
|00004fe0| 6e 74 65 72 29 0d 09 09 | 54 45 4b 65 79 20 28 63 |nter)...|TEKey (c|
|00004ff0| 2c 20 44 6f 63 54 45 20 | 28 64 6f 63 29 29 3b 0d |, DocTE |(doc));.|
|00005000| 09 41 64 6a 75 73 74 44 | 69 73 70 6c 61 79 20 28 |.AdjustD|isplay (|
|00005010| 64 6f 63 29 3b 0d 09 44 | 6f 63 44 69 72 74 79 20 |doc);..D|ocDirty |
|00005020| 28 64 6f 63 29 20 3d 20 | 74 72 75 65 3b 0d 09 69 |(doc) = |true;..i|
|00005030| 66 20 28 44 6f 63 4b 65 | 79 50 72 6f 63 20 28 64 |f (DocKe|yProc (d|
|00005040| 6f 63 29 20 21 3d 20 6e | 69 6c 29 09 2f 2a 20 72 |oc) != n|il)./* r|
|00005050| 65 70 6f 72 74 20 65 76 | 65 6e 74 20 74 6f 20 74 |eport ev|ent to t|
|00005060| 68 65 20 68 6f 73 74 20 | 2a 2f 0d 09 09 28 2a 44 |he host |*/...(*D|
|00005070| 6f 63 4b 65 79 50 72 6f | 63 20 28 64 6f 63 29 29 |ocKeyPro|c (doc))|
|00005080| 20 28 29 3b 0d 7d 0d 0d | 0d 2f 2a 0d 20 2a 20 55 | ();.}..|./*. * U|
|00005090| 70 64 61 74 65 20 77 69 | 6e 64 6f 77 2e 20 20 54 |pdate wi|ndow. T|
|000050a0| 68 65 20 75 70 64 61 74 | 65 20 65 76 65 6e 74 20 |he updat|e event |
|000050b0| 6d 69 67 68 74 20 62 65 | 20 69 6e 20 72 65 73 70 |might be| in resp|
|000050c0| 6f 6e 73 65 20 74 6f 20 | 61 0d 20 2a 20 77 69 6e |onse to |a. * win|
|000050d0| 64 6f 77 20 72 65 73 69 | 7a 69 6e 67 2e 20 20 49 |dow resi|zing. I|
|000050e0| 66 20 73 6f 2c 20 6d 6f | 76 65 20 61 6e 64 20 72 |f so, mo|ve and r|
|000050f0| 65 73 69 7a 65 20 74 68 | 65 20 73 63 72 6f 6c 6c |esize th|e scroll|
|00005100| 20 62 61 72 2c 0d 20 2a | 20 61 6e 64 20 72 65 63 | bar,. *| and rec|
|00005110| 61 6c 63 75 6c 61 74 65 | 20 74 68 65 20 74 65 78 |alculate| the tex|
|00005120| 74 20 64 69 73 70 6c 61 | 79 2e 0d 20 2a 0d 20 2a |t displa|y.. *. *|
|00005130| 20 54 68 65 20 56 61 6c | 69 64 52 65 63 74 20 63 | The Val|idRect c|
|00005140| 61 6c 6c 20 69 73 20 64 | 6f 6e 65 20 62 65 63 61 |all is d|one beca|
|00005150| 75 73 65 20 74 68 65 20 | 48 69 64 65 43 6f 6e 74 |use the |HideCont|
|00005160| 72 6f 6c 20 61 64 64 73 | 20 74 68 65 0d 20 2a 20 |rol adds| the. * |
|00005170| 63 6f 6e 74 72 6f 6c 20 | 62 6f 75 6e 64 73 20 62 |control |bounds b|
|00005180| 6f 78 20 74 6f 20 74 68 | 65 20 75 70 64 61 74 65 |ox to th|e update|
|00005190| 20 72 65 67 69 6f 6e 20 | 2d 20 77 68 69 63 68 20 | region |- which |
|000051a0| 77 6f 75 6c 64 20 67 65 | 6e 65 72 61 74 65 0d 20 |would ge|nerate. |
|000051b0| 2a 20 61 6e 6f 74 68 65 | 72 20 75 70 64 61 74 65 |* anothe|r update|
|000051c0| 20 65 76 65 6e 74 21 20 | 20 53 69 6e 63 65 20 65 | event! | Since e|
|000051d0| 76 65 72 79 74 68 69 6e | 67 20 69 73 20 72 65 64 |verythin|g is red|
|000051e0| 72 61 77 6e 20 62 65 6c | 6f 77 20 61 6e 79 77 61 |rawn bel|ow anywa|
|000051f0| 79 2c 0d 20 2a 20 74 68 | 65 20 56 61 6c 69 64 52 |y,. * th|e ValidR|
|00005200| 65 63 74 20 69 73 20 75 | 73 65 64 20 74 6f 20 63 |ect is u|sed to c|
|00005210| 61 6e 63 65 6c 20 74 68 | 65 20 75 70 64 61 74 65 |ancel th|e update|
|00005220| 2e 0d 20 2a 2f 0d 0d 73 | 74 61 74 69 63 20 70 61 |.. */..s|tatic pa|
|00005230| 73 63 61 6c 20 76 6f 69 | 64 0d 55 70 64 61 74 65 |scal voi|d.Update|
|00005240| 20 28 42 6f 6f 6c 65 61 | 6e 20 72 65 73 69 7a 65 | (Boolea|n resize|
|00005250| 64 29 0d 7b 0d 57 69 6e | 64 6f 77 50 74 72 09 77 |d).{.Win|dowPtr.w|
|00005260| 3b 0d 44 6f 63 48 61 6e | 64 6c 65 09 64 6f 63 3b |;.DocHan|dle.doc;|
|00005270| 0d 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 09 73 |.Control|Handle.s|
|00005280| 63 72 6f 6c 6c 3b 0d 54 | 45 48 61 6e 64 6c 65 09 |croll;.T|EHandle.|
|00005290| 68 54 45 3b 0d 52 65 63 | 74 09 72 3b 0d 0d 09 47 |hTE;.Rec|t.r;...G|
|000052a0| 65 74 50 6f 72 74 20 28 | 26 77 29 3b 0d 09 64 6f |etPort (|&w);..do|
|000052b0| 63 20 3d 20 57 69 6e 64 | 44 6f 63 48 61 6e 64 6c |c = Wind|DocHandl|
|000052c0| 65 20 28 77 29 3b 0d 09 | 73 63 72 6f 6c 6c 20 3d |e (w);..|scroll =|
|000052d0| 20 44 6f 63 53 63 72 6f | 6c 6c 20 28 64 6f 63 29 | DocScro|ll (doc)|
|000052e0| 3b 0d 09 68 54 45 20 3d | 20 44 6f 63 54 45 20 28 |;..hTE =| DocTE (|
|000052f0| 64 6f 63 29 3b 0d 0d 09 | 69 66 20 28 72 65 73 69 |doc);...|if (resi|
|00005300| 7a 65 64 29 0d 09 7b 0d | 09 09 72 20 3d 20 77 2d |zed)..{.|..r = w-|
|00005310| 3e 70 6f 72 74 52 65 63 | 74 3b 0d 09 09 45 72 61 |>portRec|t;...Era|
|00005320| 73 65 52 65 63 74 20 28 | 26 72 29 3b 0d 09 09 48 |seRect (|&r);...H|
|00005330| 69 64 65 43 6f 6e 74 72 | 6f 6c 20 28 73 63 72 6f |ideContr|ol (scro|
|00005340| 6c 6c 29 3b 0d 09 09 72 | 20 3d 20 28 2a 2a 73 63 |ll);...r| = (**sc|
|00005350| 72 6f 6c 6c 29 2e 63 6f | 6e 74 72 6c 52 65 63 74 |roll).co|ntrlRect|
|00005360| 3b 0d 09 09 56 61 6c 69 | 64 52 65 63 74 20 28 26 |;...Vali|dRect (&|
|00005370| 72 29 3b 0d 09 09 43 61 | 6c 63 53 63 72 6f 6c 6c |r);...Ca|lcScroll|
|00005380| 52 65 63 74 20 28 77 2c | 20 26 72 29 3b 0d 09 09 |Rect (w,| &r);...|
|00005390| 53 69 7a 65 43 6f 6e 74 | 72 6f 6c 20 28 73 63 72 |SizeCont|rol (scr|
|000053a0| 6f 6c 6c 2c 20 31 36 2c | 20 72 2e 62 6f 74 74 6f |oll, 16,| r.botto|
|000053b0| 6d 20 2d 20 72 2e 74 6f | 70 29 3b 0d 09 09 4d 6f |m - r.to|p);...Mo|
|000053c0| 76 65 43 6f 6e 74 72 6f | 6c 20 28 73 63 72 6f 6c |veContro|l (scrol|
|000053d0| 6c 2c 20 72 2e 6c 65 66 | 74 2c 20 72 2e 74 6f 70 |l, r.lef|t, r.top|
|000053e0| 29 3b 0d 09 09 4f 76 65 | 72 68 61 75 6c 44 69 73 |);...Ove|rhaulDis|
|000053f0| 70 6c 61 79 20 28 64 6f | 63 2c 20 66 61 6c 73 65 |play (do|c, false|
|00005400| 2c 20 28 2a 2a 68 54 45 | 29 2e 63 72 4f 6e 6c 79 |, (**hTE|).crOnly|
|00005410| 20 3e 3d 20 30 29 3b 0d | 09 09 53 68 6f 77 43 6f | >= 0);.|..ShowCo|
|00005420| 6e 74 72 6f 6c 20 28 73 | 63 72 6f 6c 6c 29 3b 0d |ntrol (s|croll);.|
|00005430| 09 7d 0d 09 65 6c 73 65 | 0d 09 7b 0d 09 09 4f 76 |.}..else|..{...Ov|
|00005440| 65 72 68 61 75 6c 44 69 | 73 70 6c 61 79 20 28 64 |erhaulDi|splay (d|
|00005450| 6f 63 2c 20 66 61 6c 73 | 65 2c 20 66 61 6c 73 65 |oc, fals|e, false|
|00005460| 29 3b 0d 09 09 69 66 20 | 28 57 69 6e 64 6f 77 49 |);...if |(WindowI|
|00005470| 73 41 63 74 69 76 65 20 | 28 77 29 29 0d 09 09 09 |sActive |(w))....|
|00005480| 44 72 61 77 43 6f 6e 74 | 72 6f 6c 73 20 28 77 29 |DrawCont|rols (w)|
|00005490| 3b 09 2f 2a 20 72 65 64 | 72 61 77 20 73 63 72 6f |;./* red|raw scro|
|000054a0| 6c 6c 20 62 61 72 20 2a | 2f 0d 09 09 65 6c 73 65 |ll bar *|/...else|
|000054b0| 0d 09 09 7b 0d 09 09 09 | 2f 2a 20 64 72 61 77 20 |...{....|/* draw |
|000054c0| 6f 75 74 6c 69 6e 65 20 | 6f 66 20 73 63 72 6f 6c |outline |of scrol|
|000054d0| 6c 2c 20 65 72 61 73 65 | 20 69 6e 74 65 72 69 6f |l, erase| interio|
|000054e0| 72 20 2a 2f 0d 09 09 09 | 72 20 3d 20 28 2a 2a 73 |r */....|r = (**s|
|000054f0| 63 72 6f 6c 6c 29 2e 63 | 6f 6e 74 72 6c 52 65 63 |croll).c|ontrlRec|
|00005500| 74 3b 0d 09 09 09 46 72 | 61 6d 65 52 65 63 74 20 |t;....Fr|ameRect |
|00005510| 28 26 72 29 3b 0d 09 09 | 09 49 6e 73 65 74 52 65 |(&r);...|.InsetRe|
|00005520| 63 74 20 28 26 72 2c 20 | 31 2c 20 31 29 3b 0d 09 |ct (&r, |1, 1);..|
|00005530| 09 09 45 72 61 73 65 52 | 65 63 74 20 28 26 72 29 |..EraseR|ect (&r)|
|00005540| 3b 0d 09 09 7d 0d 09 7d | 0d 0d 09 44 72 61 77 47 |;...}..}|...DrawG|
|00005550| 72 6f 77 42 6f 78 20 28 | 77 29 3b 0d 7d 0d 0d 0d |rowBox (|w);.}...|
|00005560| 2f 2a 0d 20 2a 20 57 68 | 65 6e 20 74 68 65 20 77 |/*. * Wh|en the w|
|00005570| 69 6e 64 6f 77 20 63 6f | 6d 65 73 20 61 63 74 69 |indow co|mes acti|
|00005580| 76 65 2c 20 68 69 67 68 | 6c 69 67 68 74 20 74 68 |ve, high|light th|
|00005590| 65 20 73 63 72 6f 6c 6c | 20 62 61 72 20 61 70 70 |e scroll| bar app|
|000055a0| 72 6f 70 72 69 61 74 65 | 6c 79 2e 0d 20 2a 20 57 |ropriate|ly.. * W|
|000055b0| 68 65 6e 20 74 68 65 20 | 77 69 6e 64 6f 77 20 69 |hen the |window i|
|000055c0| 73 20 64 65 61 63 74 69 | 76 61 74 65 64 2c 20 68 |s deacti|vated, h|
|000055d0| 69 64 65 20 74 68 65 20 | 73 63 72 6f 6c 6c 20 62 |ide the |scroll b|
|000055e0| 61 72 20 28 74 68 69 73 | 20 69 73 20 64 72 61 77 |ar (this| is draw|
|000055f0| 6e 0d 20 2a 20 69 6d 6d | 65 64 69 61 74 65 6c 79 |n. * imm|ediately|
|00005600| 20 72 61 74 68 65 72 20 | 74 68 61 6e 20 69 6e 76 | rather |than inv|
|00005610| 61 6c 69 64 61 74 69 6e | 67 20 74 68 65 20 72 65 |alidatin|g the re|
|00005620| 63 74 61 6e 67 6c 65 20 | 61 6e 64 20 77 61 69 74 |ctangle |and wait|
|00005630| 69 6e 67 20 66 6f 72 0d | 20 2a 20 55 70 64 61 74 |ing for.| * Updat|
|00005640| 65 28 29 2c 20 62 65 63 | 61 75 73 65 20 74 68 61 |e(), bec|ause tha|
|00005650| 74 20 6a 75 73 74 20 73 | 65 65 6d 73 20 74 6f 6f |t just s|eems too|
|00005660| 20 73 6c 6f 77 29 2e 0d | 20 2a 0d 20 2a 20 52 65 | slow)..| *. * Re|
|00005670| 64 72 61 77 20 74 68 65 | 20 67 72 6f 77 20 62 6f |draw the| grow bo|
|00005680| 78 20 69 6e 20 61 6e 79 | 20 63 61 73 65 2e 20 20 |x in any| case. |
|00005690| 53 65 74 20 74 68 65 20 | 63 75 72 73 6f 72 20 28 |Set the |cursor (|
|000056a0| 46 69 78 43 75 72 73 6f | 72 20 61 76 6f 69 64 73 |FixCurso|r avoids|
|000056b0| 0d 20 2a 20 63 68 61 6e | 67 69 6e 67 20 69 74 20 |. * chan|ging it |
|000056c0| 66 72 6f 6d 20 61 6e 20 | 69 62 65 61 6d 20 74 6f |from an |ibeam to|
|000056d0| 20 61 6e 20 61 72 72 6f | 77 20 62 61 63 6b 20 74 | an arro|w back t|
|000056e0| 6f 20 61 6e 20 69 62 65 | 61 6d 2c 20 69 6e 20 74 |o an ibe|am, in t|
|000056f0| 68 65 20 63 61 73 65 0d | 20 2a 20 77 68 65 72 65 |he case.| * where|
|00005700| 20 6f 6e 65 20 65 64 69 | 74 20 77 69 6e 64 6f 77 | one edi|t window|
|00005710| 20 69 73 20 67 6f 69 6e | 67 20 69 6e 61 63 74 69 | is goin|g inacti|
|00005720| 76 65 20 61 6e 64 20 61 | 6e 6f 74 68 65 72 20 69 |ve and a|nother i|
|00005730| 73 20 63 6f 6d 69 6e 67 | 0d 20 2a 20 61 63 74 69 |s coming|. * acti|
|00005740| 76 65 29 2e 0d 20 2a 0d | 20 2a 20 52 65 70 6f 72 |ve).. *.| * Repor|
|00005750| 74 20 74 68 65 20 65 76 | 65 6e 74 20 74 6f 20 74 |t the ev|ent to t|
|00005760| 68 65 20 68 6f 73 74 2e | 0d 20 2a 2f 0d 0d 73 74 |he host.|. */..st|
|00005770| 61 74 69 63 20 70 61 73 | 63 61 6c 20 76 6f 69 64 |atic pas|cal void|
|00005780| 0d 41 63 74 69 76 61 74 | 65 20 28 42 6f 6f 6c 65 |.Activat|e (Boole|
|00005790| 61 6e 20 61 63 74 69 76 | 65 29 0d 7b 0d 57 69 6e |an activ|e).{.Win|
|000057a0| 64 6f 77 50 74 72 09 77 | 3b 0d 44 6f 63 48 61 6e |dowPtr.w|;.DocHan|
|000057b0| 64 6c 65 09 64 6f 63 3b | 0d 43 6f 6e 74 72 6f 6c |dle.doc;|.Control|
|000057c0| 48 61 6e 64 6c 65 09 73 | 63 72 6f 6c 6c 3b 0d 54 |Handle.s|croll;.T|
|000057d0| 45 48 61 6e 64 6c 65 09 | 68 54 45 3b 0d 52 67 6e |EHandle.|hTE;.Rgn|
|000057e0| 48 61 6e 64 6c 65 09 6f | 6c 64 43 6c 69 70 3b 0d |Handle.o|ldClip;.|
|000057f0| 52 65 63 74 09 09 72 3b | 0d 0d 09 47 65 74 50 6f |Rect..r;|...GetPo|
|00005800| 72 74 20 28 26 77 29 3b | 0d 09 64 6f 63 20 3d 20 |rt (&w);|..doc = |
|00005810| 57 69 6e 64 44 6f 63 48 | 61 6e 64 6c 65 20 28 77 |WindDocH|andle (w|
|00005820| 29 3b 0d 09 73 63 72 6f | 6c 6c 20 3d 20 44 6f 63 |);..scro|ll = Doc|
|00005830| 53 63 72 6f 6c 6c 20 28 | 64 6f 63 29 3b 0d 09 68 |Scroll (|doc);..h|
|00005840| 54 45 20 3d 20 44 6f 63 | 54 45 20 28 64 6f 63 29 |TE = Doc|TE (doc)|
|00005850| 3b 0d 0d 09 44 72 61 77 | 47 72 6f 77 42 6f 78 20 |;...Draw|GrowBox |
|00005860| 28 77 29 3b 0d 09 69 66 | 20 28 61 63 74 69 76 65 |(w);..if| (active|
|00005870| 29 0d 09 7b 0d 09 09 54 | 45 41 63 74 69 76 61 74 |)..{...T|EActivat|
|00005880| 65 20 28 68 54 45 29 3b | 0d 09 09 48 69 6c 69 74 |e (hTE);|...Hilit|
|00005890| 65 53 63 72 6f 6c 6c 20 | 28 64 6f 63 29 3b 0d 09 |eScroll |(doc);..|
|000058a0| 09 53 68 6f 77 43 6f 6e | 74 72 6f 6c 20 28 73 63 |.ShowCon|trol (sc|
|000058b0| 72 6f 6c 6c 29 3b 0d 09 | 7d 0d 09 65 6c 73 65 0d |roll);..|}..else.|
|000058c0| 09 7b 0d 09 09 54 45 44 | 65 61 63 74 69 76 61 74 |.{...TED|eactivat|
|000058d0| 65 20 28 68 54 45 29 3b | 0d 09 09 2f 2a 20 68 69 |e (hTE);|.../* hi|
|000058e0| 64 65 20 73 63 72 6f 6c | 6c 20 62 75 74 20 64 6f |de scrol|l but do|
|000058f0| 6e 27 74 20 73 68 6f 77 | 20 69 74 20 62 65 69 6e |n't show| it bein|
|00005900| 67 20 68 69 64 64 65 6e | 20 2a 2f 0d 09 09 6f 6c |g hidden| */...ol|
|00005910| 64 43 6c 69 70 20 3d 20 | 4e 65 77 52 67 6e 20 28 |dClip = |NewRgn (|
|00005920| 29 3b 0d 09 09 47 65 74 | 43 6c 69 70 20 28 6f 6c |);...Get|Clip (ol|
|00005930| 64 43 6c 69 70 29 3b 0d | 09 09 53 65 74 52 65 63 |dClip);.|..SetRec|
|00005940| 74 20 28 26 72 2c 20 30 | 2c 20 30 2c 20 30 2c 20 |t (&r, 0|, 0, 0, |
|00005950| 30 29 3b 0d 09 09 43 6c | 69 70 52 65 63 74 20 28 |0);...Cl|ipRect (|
|00005960| 26 72 29 3b 0d 09 09 48 | 69 64 65 43 6f 6e 74 72 |&r);...H|ideContr|
|00005970| 6f 6c 20 28 73 63 72 6f | 6c 6c 29 3b 0d 09 09 53 |ol (scro|ll);...S|
|00005980| 65 74 43 6c 69 70 20 28 | 6f 6c 64 43 6c 69 70 29 |etClip (|oldClip)|
|00005990| 3b 0d 09 09 44 69 73 70 | 6f 73 65 52 67 6e 20 28 |;...Disp|oseRgn (|
|000059a0| 6f 6c 64 43 6c 69 70 29 | 3b 0d 09 09 2f 2a 20 6e |oldClip)|;.../* n|
|000059b0| 6f 77 20 65 72 61 73 65 | 20 69 6e 73 69 64 65 20 |ow erase| inside |
|000059c0| 6f 66 20 73 63 72 6f 6c | 6c 20 28 62 75 74 20 6e |of scrol|l (but n|
|000059d0| 6f 74 20 6f 75 74 6c 69 | 6e 65 2c 20 74 6f 20 61 |ot outli|ne, to a|
|000059e0| 76 6f 69 64 20 66 6c 69 | 63 6b 65 72 29 20 2a 2f |void fli|cker) */|
|000059f0| 0d 09 09 72 20 3d 20 28 | 2a 2a 73 63 72 6f 6c 6c |...r = (|**scroll|
|00005a00| 29 2e 63 6f 6e 74 72 6c | 52 65 63 74 3b 09 09 2f |).contrl|Rect;../|
|00005a10| 2a 20 65 72 61 73 65 20 | 73 63 72 6f 6c 6c 20 2a |* erase |scroll *|
|00005a20| 2f 0d 09 09 49 6e 73 65 | 74 52 65 63 74 20 28 26 |/...Inse|tRect (&|
|00005a30| 72 2c 20 31 2c 20 31 29 | 3b 09 09 09 2f 2a 20 62 |r, 1, 1)|;.../* b|
|00005a40| 75 74 20 6e 6f 74 20 6f | 75 74 6c 69 6e 65 20 2a |ut not o|utline *|
|00005a50| 2f 0d 09 09 45 72 61 73 | 65 52 65 63 74 20 28 26 |/...Eras|eRect (&|
|00005a60| 72 29 3b 0d 09 7d 0d 09 | 46 69 78 43 75 72 73 6f |r);..}..|FixCurso|
|00005a70| 72 20 28 69 42 65 61 6d | 43 75 72 73 6f 72 29 3b |r (iBeam|Cursor);|
|00005a80| 0d 09 69 66 20 28 44 6f | 63 41 63 74 69 76 61 74 |..if (Do|cActivat|
|00005a90| 65 50 72 6f 63 20 28 64 | 6f 63 29 20 21 3d 20 6e |eProc (d|oc) != n|
|00005aa0| 69 6c 29 09 2f 2a 20 72 | 65 70 6f 72 74 20 65 76 |il)./* r|eport ev|
|00005ab0| 65 6e 74 20 74 6f 20 74 | 68 65 20 68 6f 73 74 20 |ent to t|he host |
|00005ac0| 2a 2f 0d 09 09 28 2a 44 | 6f 63 41 63 74 69 76 61 |*/...(*D|ocActiva|
|00005ad0| 74 65 50 72 6f 63 20 28 | 64 6f 63 29 29 20 28 61 |teProc (|doc)) (a|
|00005ae0| 63 74 69 76 65 29 3b 0d | 7d 0d 0d 0d 2f 2a 0d 20 |ctive);.|}.../*. |
|00005af0| 2a 20 43 6c 6f 73 65 20 | 62 6f 78 20 77 61 73 20 |* Close |box was |
|00005b00| 63 6c 69 63 6b 65 64 2e | 20 20 49 66 20 75 73 65 |clicked.| If use|
|00005b10| 72 20 73 70 65 63 69 66 | 69 65 64 20 6e 6f 74 69 |r specif|ied noti|
|00005b20| 66 79 20 70 72 6f 63 2c | 20 63 61 6c 6c 20 69 74 |fy proc,| call it|
|00005b30| 2e 0d 20 2a 20 4f 74 68 | 65 72 77 69 73 65 20 64 |.. * Oth|erwise d|
|00005b40| 6f 20 64 65 66 61 75 6c | 74 20 63 6c 6f 73 65 20 |o defaul|t close |
|00005b50| 6f 70 65 72 61 74 69 6f | 6e 20 28 61 73 6b 20 61 |operatio|n (ask a|
|00005b60| 62 6f 75 74 20 73 61 76 | 69 6e 67 20 69 66 20 64 |bout sav|ing if d|
|00005b70| 69 72 74 79 2c 0d 20 2a | 20 65 74 63 2e 29 2e 0d |irty,. *| etc.)..|
|00005b80| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 70 61 73 63 | */..sta|tic pasc|
|00005b90| 61 6c 20 76 6f 69 64 0d | 43 6c 6f 73 65 20 28 76 |al void.|Close (v|
|00005ba0| 6f 69 64 29 0d 7b 0d 57 | 69 6e 64 6f 77 50 74 72 |oid).{.W|indowPtr|
|00005bb0| 09 77 3b 0d 44 6f 63 48 | 61 6e 64 6c 65 09 64 6f |.w;.DocH|andle.do|
|00005bc0| 63 3b 0d 0d 09 47 65 74 | 50 6f 72 74 20 28 26 77 |c;...Get|Port (&w|
|00005bd0| 29 3b 0d 09 64 6f 63 20 | 3d 20 57 69 6e 64 44 6f |);..doc |= WindDo|
|00005be0| 63 48 61 6e 64 6c 65 20 | 28 77 29 3b 0d 0d 09 69 |cHandle |(w);...i|
|00005bf0| 66 20 28 44 6f 63 43 6c | 6f 73 65 50 72 6f 63 20 |f (DocCl|oseProc |
|00005c00| 28 64 6f 63 29 20 21 3d | 20 6e 69 6c 29 0d 09 09 |(doc) !=| nil)...|
|00005c10| 28 2a 44 6f 63 43 6c 6f | 73 65 50 72 6f 63 20 28 |(*DocClo|seProc (|
|00005c20| 64 6f 63 29 29 20 28 29 | 3b 0d 09 65 6c 73 65 0d |doc)) ()|;..else.|
|00005c30| 09 09 28 76 6f 69 64 29 | 20 45 57 69 6e 64 6f 77 |..(void)| EWindow|
|00005c40| 43 6c 6f 73 65 20 28 77 | 29 3b 0d 7d 0d 0d 0d 2f |Close (w|);.}.../|
|00005c50| 2a 0d 20 2a 20 43 6c 6f | 62 62 65 72 20 61 6e 20 |*. * Clo|bber an |
|00005c60| 65 64 69 74 20 77 69 6e | 64 6f 77 2e 20 20 54 68 |edit win|dow. Th|
|00005c70| 69 73 20 72 6f 75 74 69 | 6e 65 20 69 73 20 77 72 |is routi|ne is wr|
|00005c80| 69 74 74 65 6e 20 64 65 | 66 65 6e 73 69 76 65 6c |itten de|fensivel|
|00005c90| 79 20 6f 6e 20 74 68 65 | 0d 20 2a 20 61 73 73 75 |y on the|. * assu|
|00005ca0| 6d 70 74 69 6f 6e 20 74 | 68 61 74 20 6e 6f 74 20 |mption t|hat not |
|00005cb0| 61 6c 6c 20 70 69 65 63 | 65 73 20 6f 66 20 61 20 |all piec|es of a |
|00005cc0| 63 6f 6d 70 6c 65 74 65 | 20 65 64 69 74 20 77 69 |complete| edit wi|
|00005cd0| 6e 64 6f 77 20 61 72 65 | 20 70 72 65 73 65 6e 74 |ndow are| present|
|00005ce0| 2e 0d 20 2a 20 54 68 69 | 73 20 61 6c 6c 6f 77 73 |.. * Thi|s allows|
|00005cf0| 20 69 74 20 74 6f 20 62 | 65 20 63 61 6c 6c 65 64 | it to b|e called|
|00005d00| 20 62 79 20 53 6b 65 6c | 52 6d 76 65 57 69 6e 64 | by Skel|RmveWind|
|00005d10| 28 29 20 64 75 72 69 6e | 67 20 77 69 6e 64 6f 77 |() durin|g window|
|00005d20| 20 63 72 65 61 74 69 6f | 6e 0d 20 2a 20 61 74 74 | creatio|n. * att|
|00005d30| 65 6d 70 74 73 20 69 66 | 20 61 6c 6c 6f 63 61 74 |empts if| allocat|
|00005d40| 69 6f 6e 73 20 66 61 69 | 6c 2e 0d 20 2a 0d 20 2a |ions fai|l.. *. *|
|00005d50| 20 54 68 65 20 77 69 6e | 64 6f 77 27 73 20 73 6b | The win|dow's sk|
|00005d60| 65 6c 57 50 72 6f 70 45 | 64 69 74 57 69 6e 64 20 |elWPropE|ditWind |
|00005d70| 70 72 6f 70 65 72 74 79 | 20 73 74 72 75 63 74 75 |property| structu|
|00005d80| 72 65 20 77 69 6c 6c 20 | 62 65 20 64 69 73 70 6f |re will |be dispo|
|00005d90| 73 65 64 0d 20 2a 20 6f | 66 20 62 79 20 54 72 61 |sed. * o|f by Tra|
|00005da0| 6e 73 53 6b 65 6c 2c 20 | 62 75 74 20 74 68 65 20 |nsSkel, |but the |
|00005db0| 64 61 74 61 20 61 73 73 | 6f 63 69 61 74 65 64 20 |data ass|ociated |
|00005dc0| 77 69 74 68 20 69 74 20 | 28 72 65 74 75 72 6e 65 |with it |(returne|
|00005dd0| 64 20 62 79 0d 20 2a 20 | 57 69 6e 64 44 6f 63 48 |d by. * |WindDocH|
|00005de0| 61 6e 64 6c 65 28 29 29 | 20 6d 75 73 74 20 62 65 |andle())| must be|
|00005df0| 20 64 69 73 70 6f 73 65 | 64 20 6f 66 20 68 65 72 | dispose|d of her|
|00005e00| 65 2e 0d 20 2a 0d 20 2a | 20 41 74 20 74 68 69 73 |e.. *. *| At this|
|00005e10| 20 70 6f 69 6e 74 20 69 | 74 27 73 20 74 6f 6f 20 | point i|t's too |
|00005e20| 6c 61 74 65 20 74 6f 20 | 62 61 63 6b 20 6f 75 74 |late to |back out|
|00005e30| 20 69 66 20 61 6e 79 20 | 63 68 61 6e 67 65 73 20 | if any |changes |
|00005e40| 68 61 76 65 20 62 65 65 | 6e 0d 20 2a 20 6d 61 64 |have bee|n. * mad|
|00005e50| 65 20 74 6f 20 74 68 65 | 20 74 65 78 74 2e 0d 20 |e to the| text.. |
|00005e60| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 70 61 73 63 61 |*/..stat|ic pasca|
|00005e70| 6c 20 76 6f 69 64 0d 43 | 6c 6f 62 62 65 72 20 28 |l void.C|lobber (|
|00005e80| 76 6f 69 64 29 0d 7b 0d | 57 69 6e 64 6f 77 50 74 |void).{.|WindowPt|
|00005e90| 72 09 77 3b 0d 44 6f 63 | 48 61 6e 64 6c 65 09 64 |r.w;.Doc|Handle.d|
|00005ea0| 6f 63 3b 0d 54 45 48 61 | 6e 64 6c 65 09 68 54 45 |oc;.TEHa|ndle.hTE|
|00005eb0| 3b 0d 0d 09 47 65 74 50 | 6f 72 74 20 28 26 77 29 |;...GetP|ort (&w)|
|00005ec0| 3b 0d 09 64 6f 63 20 3d | 20 57 69 6e 64 44 6f 63 |;..doc =| WindDoc|
|00005ed0| 48 61 6e 64 6c 65 20 28 | 77 29 3b 0d 0d 09 2f 2a |Handle (|w);.../*|
|00005ee0| 0d 09 20 2a 20 54 6f 73 | 73 20 64 6f 63 75 6d 65 |.. * Tos|s docume|
|00005ef0| 6e 74 20 72 65 63 6f 72 | 64 20 61 6e 64 20 61 6e |nt recor|d and an|
|00005f00| 79 20 70 69 65 63 65 73 | 20 74 68 61 74 20 65 78 |y pieces| that ex|
|00005f10| 69 73 74 0d 09 20 2a 2f | 0d 09 69 66 20 28 64 6f |ist.. */|..if (do|
|00005f20| 63 20 21 3d 20 28 44 6f | 63 48 61 6e 64 6c 65 29 |c != (Do|cHandle)|
|00005f30| 20 6e 69 6c 29 0d 09 7b | 0d 09 09 69 66 20 28 28 | nil)..{|...if ((|
|00005f40| 68 54 45 20 3d 20 44 6f | 63 54 45 20 28 64 6f 63 |hTE = Do|cTE (doc|
|00005f50| 29 29 20 21 3d 20 28 54 | 45 48 61 6e 64 6c 65 29 |)) != (T|EHandle)|
|00005f60| 20 6e 69 6c 29 0d 09 09 | 09 54 45 44 69 73 70 6f | nil)...|.TEDispo|
|00005f70| 73 65 20 28 68 54 45 29 | 3b 09 09 09 09 09 09 2f |se (hTE)|;....../|
|00005f80| 2a 20 74 6f 73 73 20 74 | 65 78 74 20 72 65 63 6f |* toss t|ext reco|
|00005f90| 72 64 20 2a 2f 0d 09 09 | 44 69 73 70 6f 73 65 48 |rd */...|DisposeH|
|00005fa0| 61 6e 64 6c 65 20 28 28 | 48 61 6e 64 6c 65 29 20 |andle ((|Handle) |
|00005fb0| 64 6f 63 29 3b 0d 09 7d | 0d 09 44 69 73 70 6f 73 |doc);..}|..Dispos|
|00005fc0| 65 57 69 6e 64 6f 77 20 | 28 77 29 3b 09 09 09 2f |eWindow |(w);.../|
|00005fd0| 2a 20 74 6f 73 73 20 77 | 69 6e 64 6f 77 20 28 73 |* toss w|indow (s|
|00005fe0| 63 72 6f 6c 6c 20 62 61 | 72 2c 20 74 6f 6f 29 20 |croll ba|r, too) |
|00005ff0| 2a 2f 0d 09 46 69 78 43 | 75 72 73 6f 72 20 28 69 |*/..FixC|ursor (i|
|00006000| 42 65 61 6d 43 75 72 73 | 6f 72 29 3b 0d 7d 0d 0d |BeamCurs|or);.}..|
|00006010| 0d 2f 2a 0d 20 2a 20 42 | 6c 69 6e 6b 20 74 68 65 |./*. * B|link the|
|00006020| 20 63 61 72 65 74 20 61 | 6e 64 20 6d 61 6b 65 20 | caret a|nd make |
|00006030| 73 75 72 65 20 74 68 65 | 20 63 75 72 73 6f 72 27 |sure the| cursor'|
|00006040| 73 20 61 6e 20 69 2d 62 | 65 61 6d 20 77 68 65 6e |s an i-b|eam when|
|00006050| 20 69 74 27 73 0d 20 2a | 20 69 6e 20 74 68 65 20 | it's. *| in the |
|00006060| 6e 6f 6e 2d 73 63 72 6f | 6c 6c 62 61 72 20 70 61 |non-scro|llbar pa|
|00006070| 72 74 20 6f 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |rt of th|e window|
|00006080| 2e 0d 20 2a 2f 0d 0d 73 | 74 61 74 69 63 20 70 61 |.. */..s|tatic pa|
|00006090| 73 63 61 6c 20 76 6f 69 | 64 0d 49 64 6c 65 20 28 |scal voi|d.Idle (|
|000060a0| 76 6f 69 64 29 0d 7b 0d | 57 69 6e 64 6f 77 50 74 |void).{.|WindowPt|
|000060b0| 72 09 77 3b 0d 44 6f 63 | 48 61 6e 64 6c 65 09 64 |r.w;.Doc|Handle.d|
|000060c0| 6f 63 3b 0d 0d 09 47 65 | 74 50 6f 72 74 20 28 26 |oc;...Ge|tPort (&|
|000060d0| 77 29 3b 0d 09 64 6f 63 | 20 3d 20 57 69 6e 64 44 |w);..doc| = WindD|
|000060e0| 6f 63 48 61 6e 64 6c 65 | 20 28 77 29 3b 0d 0d 09 |ocHandle| (w);...|
|000060f0| 54 45 49 64 6c 65 20 28 | 44 6f 63 54 45 20 28 64 |TEIdle (|DocTE (d|
|00006100| 6f 63 29 29 3b 09 09 09 | 2f 2a 20 62 6c 69 6e 6b |oc));...|/* blink|
|00006110| 20 74 68 61 74 20 63 61 | 72 65 74 21 20 2a 2f 0d | that ca|ret! */.|
|00006120| 09 46 69 78 43 75 72 73 | 6f 72 20 28 69 42 65 61 |.FixCurs|or (iBea|
|00006130| 6d 43 75 72 73 6f 72 29 | 3b 0d 7d 0d 0d 0d 2f 2a |mCursor)|;.}.../*|
|00006140| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | -------|--------|
|00006150| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006160| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006170| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006180| 2d 20 2a 2f 0d 2f 2a 09 | 09 09 09 09 09 49 6e 74 |- */./*.|.....Int|
|00006190| 65 72 6e 61 6c 20 46 69 | 6c 65 20 52 6f 75 74 69 |ernal Fi|le Routi|
|000061a0| 6e 65 73 09 09 09 09 09 | 09 2a 2f 0d 2f 2a 20 2d |nes.....|.*/./* -|
|000061b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000061c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000061d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000061e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |--------|------- |
|000061f0| 2a 2f 0d 0d 0d 2f 2a 0d | 20 2a 20 53 61 76 65 20 |*/.../*.| * Save |
|00006200| 74 68 65 20 63 6f 6e 74 | 65 6e 74 73 20 6f 66 20 |the cont|ents of |
|00006210| 74 68 65 20 65 64 69 74 | 20 77 69 6e 64 6f 77 2e |the edit| window.|
|00006220| 20 20 49 66 20 74 68 65 | 72 65 20 69 73 20 6e 6f | If the|re is no|
|00006230| 20 66 69 6c 65 20 62 6f | 75 6e 64 0d 20 2a 20 74 | file bo|und. * t|
|00006240| 6f 20 74 68 65 20 77 69 | 6e 64 6f 77 2c 20 61 73 |o the wi|ndow, as|
|00006250| 6b 20 66 6f 72 20 61 20 | 66 69 6c 65 20 6e 61 6d |k for a |file nam|
|00006260| 65 2e 20 20 49 66 20 61 | 73 6b 46 6f 72 46 69 6c |e. If a|skForFil|
|00006270| 65 20 69 73 20 74 72 75 | 65 2c 20 61 73 6b 0d 20 |e is tru|e, ask. |
|00006280| 2a 20 66 6f 72 20 61 20 | 6e 61 6d 65 20 65 76 65 |* for a |name eve|
|00006290| 6e 20 69 66 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |n if the| window |
|000062a0| 69 73 20 63 75 72 72 65 | 6e 74 6c 79 20 62 6f 75 |is curre|ntly bou|
|000062b0| 6e 64 20 74 6f 20 61 20 | 66 69 6c 65 2e 20 20 49 |nd to a |file. I|
|000062c0| 66 0d 20 2a 20 62 69 6e | 64 54 6f 46 69 6c 65 20 |f. * bin|dToFile |
|000062d0| 69 73 20 74 72 75 65 2c | 20 62 69 6e 64 20 74 68 |is true,| bind th|
|000062e0| 65 20 77 69 6e 64 6f 77 | 20 74 6f 20 74 68 65 20 |e window| to the |
|000062f0| 66 69 6c 65 20 77 72 69 | 74 74 65 6e 20 74 6f 20 |file wri|tten to |
|00006300| 28 69 66 0d 20 2a 20 74 | 68 61 74 27 73 20 64 69 |(if. * t|hat's di|
|00006310| 66 66 65 72 65 6e 74 20 | 74 68 61 6e 20 74 68 65 |fferent |than the|
|00006320| 20 63 75 72 72 65 6e 74 | 6c 79 20 62 6f 75 6e 64 | current|ly bound|
|00006330| 20 66 69 6c 65 29 2c 20 | 61 6e 64 20 63 6c 65 61 | file), |and clea|
|00006340| 72 20 74 68 65 0d 20 2a | 20 77 69 6e 64 6f 77 27 |r the. *| window'|
|00006350| 73 20 64 69 72 74 79 20 | 66 6c 61 67 2e 0d 20 2a |s dirty |flag.. *|
|00006360| 0d 20 2a 20 52 65 74 75 | 72 6e 20 74 72 75 65 20 |. * Retu|rn true |
|00006370| 69 66 20 74 68 65 20 66 | 69 6c 65 20 77 61 73 20 |if the f|ile was |
|00006380| 77 72 69 74 74 65 6e 20 | 77 69 74 68 6f 75 74 20 |written |without |
|00006390| 65 72 72 6f 72 2e 20 20 | 52 65 74 75 72 6e 20 66 |error. |Return f|
|000063a0| 61 6c 73 65 0d 20 2a 20 | 69 66 20 28 61 29 20 75 |alse. * |if (a) u|
|000063b0| 73 65 72 20 77 61 73 20 | 61 73 6b 65 64 20 66 6f |ser was |asked fo|
|000063c0| 72 20 6e 61 6d 65 20 61 | 6e 64 20 63 6c 69 63 6b |r name a|nd click|
|000063d0| 65 64 20 43 61 6e 63 65 | 6c 20 28 62 29 20 74 68 |ed Cance|l (b) th|
|000063e0| 65 72 65 20 77 61 73 0d | 20 2a 20 73 6f 6d 65 20 |ere was.| * some |
|000063f0| 65 72 72 6f 72 20 77 72 | 69 74 69 6e 67 20 74 68 |error wr|iting th|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.